feat(pug): improve syntax highlighting

This commit is contained in:
ObserverOfTime 2023-07-07 13:18:30 +03:00 committed by Amaan Qureshi
parent 1ef286e5b0
commit ec7db4ba3f
2 changed files with 79 additions and 26 deletions

View file

@ -166,6 +166,9 @@
(super) (super)
] @variable.builtin ] @variable.builtin
((identifier) @variable.builtin
(#eq? @variable.builtin "self"))
[ [
(true) (true)
(false) (false)

View file

@ -1,7 +1,7 @@
(comment) @comment (comment) @comment @spell
(tag_name) @tag (tag_name) @tag
( ((tag_name) @constant.builtin
(tag_name) @constant.builtin
; https://www.script-example.com/html-tag-liste ; https://www.script-example.com/html-tag-liste
(#any-of? @constant.builtin (#any-of? @constant.builtin
"head" "title" "base" "link" "meta" "style" "head" "title" "base" "link" "meta" "style"
@ -13,18 +13,68 @@
"table" "caption" "colgroup" "col" "tbody" "thead" "tfoot" "tr" "td" "th " "table" "caption" "colgroup" "col" "tbody" "thead" "tfoot" "tr" "td" "th "
"form" "label" "input" "button" "select" "datalist" "optgroup" "option" "textarea" "output" "progress" "meter" "fieldset" "legend" "form" "label" "input" "button" "select" "datalist" "optgroup" "option" "textarea" "output" "progress" "meter" "fieldset" "legend"
"details" "summary" "dialog" "details" "summary" "dialog"
"script" "noscript" "template" "slot" "canvas") "script" "noscript" "template" "slot" "canvas"))
)
(content) @none
(quoted_attribute_value) @string
(id) @constant (id) @constant
(class) @constant (class) @property
(attribute_name) @symbol
( (doctype) @preproc
(attribute_name ) @keyword
(#match? @keyword "^(:|v-bind|v-|\\@)") (content) @none
) @keyword
(tag
(attributes
(attribute
(attribute_name) @tag.attribute
"=" @operator)))
((tag
(attributes
(attribute (attribute_name) @keyword)))
(#match? @keyword "^(:|v-bind|v-|\\@)"))
(quoted_attribute_value) @string
(include (keyword) @include)
(extends (keyword) @include)
(filename) @string.special
(block_definition (keyword) @keyword)
(block_append (keyword)+ @keyword)
(block_prepend (keyword)+ @keyword)
(block_name) @type
(conditional (keyword) @conditional)
(case
(keyword) @conditional
(when (keyword) @conditional)+)
(each (keyword) @repeat)
(while (keyword) @repeat)
(mixin_use
"+" @punctuation.delimiter
(mixin_name) @function.call)
(mixin_definition
(keyword) @keyword.function
(mixin_name) @function)
(mixin_attributes
(attribute_name) @parameter)
(filter
":" @punctuation.delimiter
(filter_name) @method.call)
(filter
(attributes
(attribute (attribute_name) @parameter)))
[ [
":" "(" ")"
] @punctuation.delimiter "#{" "}"
;; unsupported
; "!{"
; "#[" "]"
] @punctuation.bracket
[ "," "." "|" ] @punctuation.delimiter
(buffered_code "=" @punctuation.delimiter)
(unbuffered_code "-" @punctuation.delimiter)
(unescaped_buffered_code "!=" @punctuation.delimiter)