2017-02-18 20:17:07 +00:00
|
|
|
filetype: javascript
|
|
|
|
|
|
2017-03-21 19:07:39 +00:00
|
|
|
detect:
|
2018-09-29 17:43:10 +00:00
|
|
|
filename: "(\\.js$|\\.es[5678]?$|\\.mjs$)"
|
2017-10-06 15:00:31 +00:00
|
|
|
header: "^#!.*/(env +)?node( |$)"
|
2017-02-18 20:17:07 +00:00
|
|
|
|
|
|
|
|
rules:
|
2017-03-21 19:07:39 +00:00
|
|
|
- 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]?"
|
2019-11-16 01:42:17 +00:00
|
|
|
#- identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
|
|
|
|
|
# ^ this is not correct usage of the identifier color
|
2017-10-06 14:59:43 +00:00
|
|
|
- symbol.brackets: "(\\{|\\})"
|
|
|
|
|
- symbol.brackets: "(\\(|\\))"
|
|
|
|
|
- symbol.brackets: "(\\[|\\])"
|
|
|
|
|
- symbol.brackets: "(\\{|\\})"
|
|
|
|
|
- symbol.brackets: "(\\(|\\))"
|
|
|
|
|
- symbol.brackets: "(\\[|\\])"
|
2017-12-03 22:30:29 +00:00
|
|
|
- symbol.operator: "[-+/*=<>!~%?:&|]"
|
|
|
|
|
- statement: "\\b(async|await|break|case|catch|const|continue|debugger|default|delete|do|else|export|finally)\\b"
|
2018-09-30 02:23:42 +00:00
|
|
|
- statement: "\\b(for|function|class|extends|get|if|import|from|in|of|instanceof|let|new|return|set)\\b"
|
2017-12-03 22:30:29 +00:00
|
|
|
- statement: "\\b(super|switch|this|throw|try|typeof|var|void|while|with|yield)\\b"
|
|
|
|
|
# reserved but unassigned
|
2019-11-16 01:42:17 +00:00
|
|
|
- error: "\\b(enum|implements|interface|package|private|protected|public|TODO)"
|
|
|
|
|
- constant: "\\b(globalThis|Infinity|null|undefined|NaN)\\b"
|
2017-03-21 19:07:39 +00:00
|
|
|
- constant: "\\b(null|undefined|NaN)\\b"
|
|
|
|
|
- constant: "\\b(true|false)\\b"
|
2019-11-16 01:42:17 +00:00
|
|
|
- type: "\\b(Array|Boolean|Date|Enumerator|Error|Function|Math|Map|Set|WeakMap|WeakSet)\\b"
|
2017-02-18 20:17:07 +00:00
|
|
|
- type: "\\b(Number|Object|RegExp|String)\\b"
|
2018-01-17 22:19:03 +00:00
|
|
|
# - constant: "/[^*]([^/]|(\\\\/))*[^\\\\]/[gim]*"
|
2017-02-18 20:17:07 +00:00
|
|
|
- constant: "\\\\[0-7][0-7]?[0-7]?|\\\\x[0-9a-fA-F]+|\\\\[bfnrt'\"\\?\\\\]"
|
2018-01-17 22:19:03 +00:00
|
|
|
- comment: "^#!.*/(env +)?node( |$)"
|
|
|
|
|
|
2019-11-16 01:42:17 +00:00
|
|
|
- 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"
|
|
|
|
|
|
2017-03-21 19:07:39 +00:00
|
|
|
|
|
|
|
|
- constant.string:
|
|
|
|
|
start: "\""
|
2017-03-28 00:53:08 +00:00
|
|
|
end: "\""
|
2017-03-29 13:45:16 +00:00
|
|
|
skip: "\\\\."
|
2017-03-21 19:07:39 +00:00
|
|
|
rules:
|
|
|
|
|
- constant.specialChar: "\\\\."
|
|
|
|
|
|
|
|
|
|
- constant.string:
|
|
|
|
|
start: "'"
|
2017-03-28 00:53:08 +00:00
|
|
|
end: "'"
|
2017-03-29 13:45:16 +00:00
|
|
|
skip: "\\\\."
|
2017-03-21 19:07:39 +00:00
|
|
|
rules:
|
|
|
|
|
- constant.specialChar: "\\\\."
|
|
|
|
|
|
2017-12-03 22:30:29 +00:00
|
|
|
- constant.string:
|
|
|
|
|
start: "`"
|
|
|
|
|
end: "`"
|
|
|
|
|
rules:
|
|
|
|
|
- constant.specialChar: "\\\\."
|
|
|
|
|
|
2017-03-21 19:07:39 +00:00
|
|
|
- comment:
|
|
|
|
|
start: "//"
|
|
|
|
|
end: "$"
|
|
|
|
|
rules: []
|
|
|
|
|
|
|
|
|
|
- comment:
|
|
|
|
|
start: "/\\*"
|
|
|
|
|
end: "\\*/"
|
|
|
|
|
rules: []
|
2017-03-22 23:03:06 +00:00
|
|
|
|