From 585f123837761877937c5bbcee592189e43e134f Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Fri, 29 Aug 2014 16:29:12 -0400 Subject: [PATCH 1/2] Update JavaScript keywords list to ES5, add globals --- js.jsf | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/js.jsf b/js.jsf index 6c59940..9101bab 100644 --- a/js.jsf +++ b/js.jsf @@ -12,6 +12,7 @@ =Escape bold cyan =Type bold =Keyword bold +=Global bold =Operator bold =Bad inverse bold red =Brace magenta @@ -226,39 +227,73 @@ * ident_end noeat markend strings "arguments" kw "Array" type + "ArrayBuffer" type "break" kw "Boolean" type "case" kw "catch" kw + "const" global "continue" kw + "DataView" type + "decodeURI" global + "decodeURIComponent" global "default" kw "delete" operator "do" kw "Date" type "else" kw + "encodeURI" global + "encodeURIComponent" global + "Error" type + "escape" global + "eval" global + "EvalError" type "false" lit "finally" kw "for" kw "function" kw "Function" type + "Float32Array" type + "Float64Array" type "if" kw "in" kw + "Infinity" lit "instanceof" operator + "Int16Array" type + "Int32Array" type + "Int8Array" type + "isFinite" global + "isNaN" global + "JSON" type "let" kw + "Math" type + "NaN" lit "new" operator "null" lit "Number" type "Object" type + "parseFloat" global + "parseInt" global "return" kw + "RangeError" type + "ReferenceError" type "RegExp" type "switch" kw "String" type + "SyntaxError" type "this" kw "throw" kw "true" lit "try" kw "typeof" operator + "TypeError" type + "Uint16Array" type + "Uint32Array" type + "Uint8Array" type + "Uint8ClampedArray" type "undefined" lit + "unescape" global + "URIError" type "var" kw "void" kw "while" kw @@ -274,6 +309,9 @@ done :kw Keyword * idle noeat +:global Global + * idle noeat + :lit Constant * after_term noeat From a7db2eb736bf35198b1336db38550277811a753a Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Fri, 29 Aug 2014 16:50:14 -0400 Subject: [PATCH 2/2] Add Node.js globals, quasi-keywords and export highlighting --- js.jsf | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/js.jsf b/js.jsf index 9101bab..b5ea595 100644 --- a/js.jsf +++ b/js.jsf @@ -13,6 +13,7 @@ =Type bold =Keyword bold =Global bold +=Exports bold black =Operator bold =Bad inverse bold red =Brace magenta @@ -300,6 +301,22 @@ "with" kw # quasi-keywords "prototype" kw + # Node.js + "module" global + "exports" export + "process" global + "global" global + "console" global + "setTimeout" global + "setInterval" global + "clearInterval" global + "Buffer" type + # Node.js globals that we'll pretend are keywords + "require" kw + "__filename" kw + "__dirname" kw + # By convention... + "self" kw done "a-zA-Z0-9_" ident @@ -312,6 +329,9 @@ done :global Global * idle noeat +:export Exports + * idle noeat + :lit Constant * after_term noeat