Merge pull request #1415 from dullbananas/master

Improve syntax files
This commit is contained in:
Zachary Yedidia 2019-12-19 10:05:30 -05:00 committed by GitHub
commit 8817d711b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 2 deletions

View file

@ -8,7 +8,8 @@ rules:
- constant.number: "\\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\\b"
- constant.number: "\\b[-+]?([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
- constant.number: "\\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
- identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
#- identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
# ^ this is not correct usage of the identifier color
- symbol.brackets: "(\\{|\\})"
- symbol.brackets: "(\\(|\\))"
- symbol.brackets: "(\\[|\\])"
@ -21,14 +22,19 @@ rules:
- statement: "\\b(super|switch|this|throw|try|typeof|var|void|while|with|yield)\\b"
# reserved but unassigned
- error: "\\b(enum|implements|interface|package|private|protected|public|TODO)"
- constant: "\\b(globalThis|Infinity|null|undefined|NaN)\\b"
- constant: "\\b(null|undefined|NaN)\\b"
- constant: "\\b(true|false)\\b"
- type: "\\b(Array|Boolean|Date|Enumerator|Error|Function|Math)\\b"
- type: "\\b(Array|Boolean|Date|Enumerator|Error|Function|Math|Map|Set|WeakMap|WeakSet)\\b"
- type: "\\b(Number|Object|RegExp|String)\\b"
# - constant: "/[^*]([^/]|(\\\\/))*[^\\\\]/[gim]*"
- constant: "\\\\[0-7][0-7]?[0-7]?|\\\\x[0-9a-fA-F]+|\\\\[bfnrt'\"\\?\\\\]"
- comment: "^#!.*/(env +)?node( |$)"
- identifier: "\\b(alert|decodeURI|decodeURIComponent|document|encodeURI|encodeURIComponent|escape|eval|isFinite|isNaN|parseFloat|parseInt|unescape|uneval|window)\\b"
- identifier: "\\b(Intl|WebAssembly)\\b"
- identifier: "\\b(Arguments)\\b"
- constant.string:
start: "\""

View file

@ -0,0 +1,22 @@
filetype: jinja2
detect:
filename: "\\.html$"
rules:
- include: "html"
- special: "({{|}}|{%-?|-?%})"
- default:
start: "({%-?|{{)"
end: "(-?%}|}})"
limit-group: special
rules:
- include: "python"
- statement: "\\b(ignore missing|with(out)? context|block|call|endblock|endcall|endfilter|endfor|endmacro|endraw|endset|extends|filter|for|include|macro|raw|recursive|scoped|set)\\b"
- identifier.builtinfunc: "\\b(attr|batch|capitalize|center|count|d|default|dictsort|e|escape|filesizeformat|first|forceescape|groupby|indent|join|last|length|lower|pprint|random|reject|rejectattr|replace|reverse|safe|select|selectattr|striptags|title|tojson|trim|truncate|unique|upper|urlencode|urlize|wordcount|wordwrap|xmlattr)\\b"
- identifier.builtintest: "\\b(callable|defined|divisibleby|eq|equalto|escaped|even|ge|gt|iterable|le|lower|lt|mapping|ne|none|number|odd|sameas|sequence|string|undefined|upper)\\b"
- identifier.defaultglobal: "\\b(lipsum|cycler|joiner|namespace)\\b"
- comment:
start: "{#"
end: "#}"
rules: []