X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=runtime%2Fsyntax%2Fjavascript.yaml;h=f0ec9b97710ed0db4f46ee6594bc2256eb763369;hb=e420872a270e351653f62756cda24892dc1417c9;hp=244ad8110db96a68165c8621ce7a6963cb5bec6b;hpb=1c4e2eb09fe980394330499708311abe8fb7d719;p=micro.git diff --git a/runtime/syntax/javascript.yaml b/runtime/syntax/javascript.yaml index 244ad811..f0ec9b97 100644 --- a/runtime/syntax/javascript.yaml +++ b/runtime/syntax/javascript.yaml @@ -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: "\""