| 1 |
filetype: javascript |
| 2 |
|
| 3 |
detect: |
| 4 |
filename: "(\\.(m|c)?js$|\\.es[5678]?$)" |
| 5 |
header: "^#!.*/(env +)?node( |$)" |
| 6 |
|
| 7 |
rules: |
| 8 |
- constant.number: "\\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\\b" |
| 9 |
- constant.number: "\\b[-+]?([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?" |
| 10 |
- constant.number: "\\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?" |
| 11 |
#- identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]" |
| 12 |
# ^ this is not correct usage of the identifier color |
| 13 |
- symbol.brackets: "[(){}]|\\[|\\]" |
| 14 |
- symbol.operator: "([-+/*=<>!~%?:&|]|[.]{3})" |
| 15 |
- statement: "\\b(async|await|break|case|catch|const|continue|debugger|default)\\b" |
| 16 |
- statement: "\\b(delete|do|else|export|finally|for|function\\*?|class|extends)\\b" |
| 17 |
- statement: "\\b(get|if|import|from|in|of|instanceof|let|new|reject|resolve|return)\\b" |
| 18 |
- statement: "\\b(set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\\b" |
| 19 |
# reserved but unassigned |
| 20 |
- error: "\\b(enum|implements|interface|package|private|protected|public)\\b" |
| 21 |
- constant: "\\b(globalThis|Infinity|null|undefined|NaN)\\b" |
| 22 |
- constant: "\\b(null|undefined|NaN)\\b" |
| 23 |
- constant: "\\b(true|false)\\b" |
| 24 |
- type: "\\b(Array|Boolean|Date|Enumerator|Error|Function|Generator|Map|Math)\\b" |
| 25 |
- type: "\\b(Number|Object|Promise|Proxy|Reflect|RegExp|Set|String|Symbol|WeakMap|WeakSet)\\b" |
| 26 |
- type: "\\b(BigInt64Array|BigUint64Array|Float32Array|Float64Array|Int16Array)\\b" |
| 27 |
|
| 28 |
# - constant: "/[^*]([^/]|(\\\\/))*[^\\\\]/[gim]*" |
| 29 |
- constant: "\\\\[0-7][0-7]?[0-7]?|\\\\x[0-9a-fA-F]+|\\\\[bfnrt'\"\\?\\\\]" |
| 30 |
- comment: "^#!.*/(env +)?node( |$)" |
| 31 |
|
| 32 |
- identifier: "\\b(alert|decodeURI|decodeURIComponent|document|encodeURI|encodeURIComponent|escape|eval|isFinite|isNaN|parseFloat|parseInt|unescape|uneval|window)\\b" |
| 33 |
- identifier: "\\b(Intl|WebAssembly)\\b" |
| 34 |
- identifier: "\\b(Arguments)\\b" |
| 35 |
|
| 36 |
|
| 37 |
- constant.string: |
| 38 |
start: "\"" |
| 39 |
end: "\"" |
| 40 |
skip: "\\\\." |
| 41 |
rules: |
| 42 |
- constant.specialChar: "\\\\." |
| 43 |
|
| 44 |
- constant.string: |
| 45 |
start: "'" |
| 46 |
end: "'" |
| 47 |
skip: "\\\\." |
| 48 |
rules: |
| 49 |
- constant.specialChar: "\\\\." |
| 50 |
|
| 51 |
- constant.string: |
| 52 |
start: "`" |
| 53 |
end: "`" |
| 54 |
rules: |
| 55 |
- constant.specialChar: "\\\\." |
| 56 |
- identifier: "\\x24\\{.*?\\}" |
| 57 |
|
| 58 |
- constant.bool: "\\b(true|false)\\b" |
| 59 |
- constant.bool.false: "\\b(false)\\b" |
| 60 |
- constant.bool.true: "\\b(true)\\b" |
| 61 |
|
| 62 |
- comment: |
| 63 |
start: "//" |
| 64 |
end: "$" |
| 65 |
rules: |
| 66 |
- todo: "(TODO|XXX|FIXME)" |
| 67 |
|
| 68 |
- comment: |
| 69 |
start: "/\\*" |
| 70 |
end: "\\*/" |
| 71 |
skip: "\\\\." |
| 72 |
rules: |
| 73 |
- constant.specialChar: "\\\\." |
| 74 |
# function documentation |
| 75 |
- identifier: "\\s\\*\\s.*" |
| 76 |
- todo: "(TODO|XXX|FIXME)" |