Feat: Added Pug parser with inital queries

This commit is contained in:
Stefan Wienert 2021-07-10 17:36:49 +02:00 committed by Stephan Seitz
parent 81d4077fa0
commit dec2ba27a8
5 changed files with 53 additions and 0 deletions

1
ftdetect/pug.vim Normal file
View file

@ -0,0 +1 @@
au BufRead,BufNewFile *.pug setlocal filetype=pug

View file

@ -470,6 +470,15 @@ list.glimmer = {
used_by = { "html.handlebars" },
}
list.pug = {
install_info = {
url = "https://github.com/zealot128/tree-sitter-pug",
files = { "src/parser.c", "src/scanner.cc" },
},
maintainers = { "@zealot128" },
filetype = "pug",
}
list.vue = {
install_info = {
url = "https://github.com/ikatyang/tree-sitter-vue",

View file

@ -0,0 +1,27 @@
(comment) @comment
(tag_name) @tag
(
(tag_name) @constant.builtin
; https://www.script-example.com/html-tag-liste
(#any-of? @constant.builtin
"head" "title" "base" "link" "meta" "style"
"body" "article" "section" "nav" "aside" "h1" "h2" "h3" "h4" "h5" "h6" "hgroup" "header" "footer" "address"
"p" "hr" "pre" "blockquote" "ol" "ul" "menu" "li" "dl" "dt" "dd" "figure" "figcaption" "main" "div"
"a" "em" "strong" "small" "s" "cite" "q" "dfn" "abbr" "ruby" "rt" "rp" "data" "time" "code" "var" "samp" "kbd" "sub" "sup" "i" "b" "u" "mark" "bdi" "bdo" "span" "br" "wbr"
"ins" "del"
"picture" "source" "img" "iframe" "embed" "object" "param" "video" "audio" "track" "map" "area"
"table" "caption" "colgroup" "col" "tbody" "thead" "tfoot" "tr" "td" "th "
"form" "label" "input" "button" "select" "datalist" "optgroup" "option" "textarea" "output" "progress" "meter" "fieldset" "legend"
"details" "summary" "dialog"
"script" "noscript" "template" "slot" "canvas")
)
(content) @none
(quoted_attribute_value) @string
(id) @constant
(class) @constant
(attribute_name) @symbol
(
(attribute_name ) @keyword
(#match? @keyword "^(:|v-bind|v-|\\@)")
) @keyword

View file

@ -0,0 +1,7 @@
(javascript) @javascript
(
(attribute_name) @_attribute_name
(quoted_attribute_value (attribute_value ) @javascript)
(#match? @_attribute_name "^(:|v-bind|v-|\\@)")
)

View file

@ -25,4 +25,13 @@
(quoted_attribute_value
(attribute_value) @javascript)))
(
(template_element
(start_tag
(attribute
(quoted_attribute_value (attribute_value) @_lang)))
(raw_text) @pug)
(#match? @_lang "pug")
)
(comment) @comment