class

Noir::Lexers::JavaScript

Inherits Noir::Lexer / Noir::Tokens / Reference / Object

Constants

BUILTINS = Set.new(["Array", "Boolean", "Date", "Error", "Function", "Math", "netscape", "Number", "Object", "Packages", "RegExp", "String", "sun", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", "Error", "eval", "isFinite", "isNaN", "parseFloat", "parseInt", "document", "window", "navigator", "self", "global", "Promise", "Set", "Map", "WeakSet", "WeakMap", "Symbol", "Proxy", "Reflect", "Int8Array", "Uint8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array", "Uint16ClampedArray", "Int32Array", "Uint32Array", "Uint32ClampedArray", "Float32Array", "Float64Array", "DataView", "ArrayBuffer"] of ::String)
CONSTANTS = Set.new(["true", "false", "null", "NaN", "Infinity", "undefined"] of ::String)
DECLARATIONS = Set.new(["var", "let", "const", "with", "function", "class", "extends", "constructor", "get", "set"] of ::String)
ID_REGEX = /[a-z_$][a-z0-9_$]*/i
KEYWORDS = Set.new(["for", "in", "of", "while", "do", "break", "return", "continue", "switch", "case", "default", "if", "else", "throw", "try", "catch", "finally", "new", "delete", "typeof", "instanceof", "void", "this", "yield", "import", "export", "from", "as", "async", "super"] of ::String)
RESERVED = Set.new(["abstract", "boolean", "byte", "char", "debugger", "double", "enum", "final", "float", "goto", "implements", "int", "interface", "long", "native", "package", "private", "protected", "public", "short", "static", "synchronized", "throws", "transient", "volatile", "eval", "arguments", "await"] of ::String)