rum-goggles/v1/vendor/github.com/robertkrimen/otto/token/token_const.go

352 lines
7.1 KiB
Go
Raw Normal View History

2024-04-04 14:46:14 +00:00
// Code generated by tools/gen-tokens. DO NOT EDIT.
package token
const (
_ Token = iota
2024-04-04 14:46:14 +00:00
// Control.
ILLEGAL
EOF
COMMENT
KEYWORD
2024-04-04 14:46:14 +00:00
// Types.
STRING
BOOLEAN
NULL
NUMBER
IDENTIFIER
2024-04-04 14:46:14 +00:00
// Maths.
PLUS // +
MINUS // -
MULTIPLY // *
SLASH // /
REMAINDER // %
2024-04-04 14:46:14 +00:00
// Logical and bitwise operators.
AND // &
OR // |
EXCLUSIVE_OR // ^
SHIFT_LEFT // <<
SHIFT_RIGHT // >>
UNSIGNED_SHIFT_RIGHT // >>>
AND_NOT // &^
2024-04-04 14:46:14 +00:00
// Math assignments.
ADD_ASSIGN // +=
SUBTRACT_ASSIGN // -=
MULTIPLY_ASSIGN // *=
QUOTIENT_ASSIGN // /=
REMAINDER_ASSIGN // %=
2024-04-04 14:46:14 +00:00
// Math and bitwise assignments.
AND_ASSIGN // &=
OR_ASSIGN // |=
EXCLUSIVE_OR_ASSIGN // ^=
SHIFT_LEFT_ASSIGN // <<=
SHIFT_RIGHT_ASSIGN // >>=
UNSIGNED_SHIFT_RIGHT_ASSIGN // >>>=
AND_NOT_ASSIGN // &^=
2024-04-04 14:46:14 +00:00
// Logical operators and decrement / increment.
LOGICAL_AND // &&
LOGICAL_OR // ||
INCREMENT // ++
DECREMENT // --
2024-04-04 14:46:14 +00:00
// Comparison operators.
EQUAL // ==
STRICT_EQUAL // ===
LESS // <
GREATER // >
ASSIGN // =
NOT // !
2024-04-04 14:46:14 +00:00
// Bitwise not.
BITWISE_NOT // ~
2024-04-04 14:46:14 +00:00
// Comparison operators.
NOT_EQUAL // !=
STRICT_NOT_EQUAL // !==
LESS_OR_EQUAL // <=
GREATER_OR_EQUAL // >=
2024-04-04 14:46:14 +00:00
// Left operators.
LEFT_PARENTHESIS // (
LEFT_BRACKET // [
LEFT_BRACE // {
COMMA // ,
PERIOD // .
2024-04-04 14:46:14 +00:00
// Right operators.
RIGHT_PARENTHESIS // )
RIGHT_BRACKET // ]
RIGHT_BRACE // }
SEMICOLON // ;
COLON // :
QUESTION_MARK // ?
2024-04-04 14:46:14 +00:00
// Basic flow - keywords below here.
_
IF
IN
DO
2024-04-04 14:46:14 +00:00
// Declarations.
VAR
FOR
NEW
TRY
2024-04-04 14:46:14 +00:00
// Advanced flow.
THIS
ELSE
CASE
VOID
WITH
2024-04-04 14:46:14 +00:00
// Loops.
WHILE
BREAK
CATCH
THROW
2024-04-04 14:46:14 +00:00
// Functions.
RETURN
TYPEOF
DELETE
SWITCH
2024-04-04 14:46:14 +00:00
// Fallback identifiers.
DEFAULT
FINALLY
2024-04-04 14:46:14 +00:00
// Miscellaneous.
FUNCTION
CONTINUE
DEBUGGER
2024-04-04 14:46:14 +00:00
// Instance of.
INSTANCEOF
)
var token2string = [...]string{
ILLEGAL: "ILLEGAL",
EOF: "EOF",
COMMENT: "COMMENT",
KEYWORD: "KEYWORD",
STRING: "STRING",
BOOLEAN: "BOOLEAN",
NULL: "NULL",
NUMBER: "NUMBER",
IDENTIFIER: "IDENTIFIER",
PLUS: "+",
MINUS: "-",
MULTIPLY: "*",
SLASH: "/",
REMAINDER: "%",
AND: "&",
OR: "|",
EXCLUSIVE_OR: "^",
SHIFT_LEFT: "<<",
SHIFT_RIGHT: ">>",
UNSIGNED_SHIFT_RIGHT: ">>>",
AND_NOT: "&^",
ADD_ASSIGN: "+=",
SUBTRACT_ASSIGN: "-=",
MULTIPLY_ASSIGN: "*=",
QUOTIENT_ASSIGN: "/=",
REMAINDER_ASSIGN: "%=",
AND_ASSIGN: "&=",
OR_ASSIGN: "|=",
EXCLUSIVE_OR_ASSIGN: "^=",
SHIFT_LEFT_ASSIGN: "<<=",
SHIFT_RIGHT_ASSIGN: ">>=",
UNSIGNED_SHIFT_RIGHT_ASSIGN: ">>>=",
AND_NOT_ASSIGN: "&^=",
LOGICAL_AND: "&&",
LOGICAL_OR: "||",
INCREMENT: "++",
DECREMENT: "--",
EQUAL: "==",
STRICT_EQUAL: "===",
LESS: "<",
GREATER: ">",
ASSIGN: "=",
NOT: "!",
BITWISE_NOT: "~",
NOT_EQUAL: "!=",
STRICT_NOT_EQUAL: "!==",
LESS_OR_EQUAL: "<=",
GREATER_OR_EQUAL: ">=",
LEFT_PARENTHESIS: "(",
LEFT_BRACKET: "[",
LEFT_BRACE: "{",
COMMA: ",",
PERIOD: ".",
RIGHT_PARENTHESIS: ")",
RIGHT_BRACKET: "]",
RIGHT_BRACE: "}",
SEMICOLON: ";",
COLON: ":",
QUESTION_MARK: "?",
IF: "if",
IN: "in",
DO: "do",
VAR: "var",
FOR: "for",
NEW: "new",
TRY: "try",
THIS: "this",
ELSE: "else",
CASE: "case",
VOID: "void",
WITH: "with",
WHILE: "while",
BREAK: "break",
CATCH: "catch",
THROW: "throw",
RETURN: "return",
TYPEOF: "typeof",
DELETE: "delete",
SWITCH: "switch",
DEFAULT: "default",
FINALLY: "finally",
FUNCTION: "function",
CONTINUE: "continue",
DEBUGGER: "debugger",
INSTANCEOF: "instanceof",
}
2024-04-04 14:46:14 +00:00
var keywordTable = map[string]keyword{
"if": {
token: IF,
},
2024-04-04 14:46:14 +00:00
"in": {
token: IN,
},
2024-04-04 14:46:14 +00:00
"do": {
token: DO,
},
2024-04-04 14:46:14 +00:00
"var": {
token: VAR,
},
2024-04-04 14:46:14 +00:00
"for": {
token: FOR,
},
2024-04-04 14:46:14 +00:00
"new": {
token: NEW,
},
2024-04-04 14:46:14 +00:00
"try": {
token: TRY,
},
2024-04-04 14:46:14 +00:00
"this": {
token: THIS,
},
2024-04-04 14:46:14 +00:00
"else": {
token: ELSE,
},
2024-04-04 14:46:14 +00:00
"case": {
token: CASE,
},
2024-04-04 14:46:14 +00:00
"void": {
token: VOID,
},
2024-04-04 14:46:14 +00:00
"with": {
token: WITH,
},
2024-04-04 14:46:14 +00:00
"while": {
token: WHILE,
},
2024-04-04 14:46:14 +00:00
"break": {
token: BREAK,
},
2024-04-04 14:46:14 +00:00
"catch": {
token: CATCH,
},
2024-04-04 14:46:14 +00:00
"throw": {
token: THROW,
},
2024-04-04 14:46:14 +00:00
"return": {
token: RETURN,
},
2024-04-04 14:46:14 +00:00
"typeof": {
token: TYPEOF,
},
2024-04-04 14:46:14 +00:00
"delete": {
token: DELETE,
},
2024-04-04 14:46:14 +00:00
"switch": {
token: SWITCH,
},
2024-04-04 14:46:14 +00:00
"default": {
token: DEFAULT,
},
2024-04-04 14:46:14 +00:00
"finally": {
token: FINALLY,
},
2024-04-04 14:46:14 +00:00
"function": {
token: FUNCTION,
},
2024-04-04 14:46:14 +00:00
"continue": {
token: CONTINUE,
},
2024-04-04 14:46:14 +00:00
"debugger": {
token: DEBUGGER,
},
2024-04-04 14:46:14 +00:00
"instanceof": {
token: INSTANCEOF,
},
2024-04-04 14:46:14 +00:00
"const": {
token: KEYWORD,
futureKeyword: true,
},
2024-04-04 14:46:14 +00:00
"class": {
token: KEYWORD,
futureKeyword: true,
},
2024-04-04 14:46:14 +00:00
"enum": {
token: KEYWORD,
futureKeyword: true,
},
2024-04-04 14:46:14 +00:00
"export": {
token: KEYWORD,
futureKeyword: true,
},
2024-04-04 14:46:14 +00:00
"extends": {
token: KEYWORD,
futureKeyword: true,
},
2024-04-04 14:46:14 +00:00
"import": {
token: KEYWORD,
futureKeyword: true,
},
2024-04-04 14:46:14 +00:00
"super": {
token: KEYWORD,
futureKeyword: true,
},
2024-04-04 14:46:14 +00:00
"implements": {
token: KEYWORD,
futureKeyword: true,
strict: true,
},
2024-04-04 14:46:14 +00:00
"interface": {
token: KEYWORD,
futureKeyword: true,
strict: true,
},
2024-04-04 14:46:14 +00:00
"let": {
token: KEYWORD,
futureKeyword: true,
strict: true,
},
2024-04-04 14:46:14 +00:00
"package": {
token: KEYWORD,
futureKeyword: true,
strict: true,
},
2024-04-04 14:46:14 +00:00
"private": {
token: KEYWORD,
futureKeyword: true,
strict: true,
},
2024-04-04 14:46:14 +00:00
"protected": {
token: KEYWORD,
futureKeyword: true,
strict: true,
},
2024-04-04 14:46:14 +00:00
"public": {
token: KEYWORD,
futureKeyword: true,
strict: true,
},
2024-04-04 14:46:14 +00:00
"static": {
token: KEYWORD,
futureKeyword: true,
strict: true,
},
}