package token
Import Path
github.com/dop251/goja/token (on go.dev)
Dependency Relation
imports one package, and imported by 3 packages
Involved Source Files
Package token defines constants representing the lexical tokens of JavaScript (ECMA5).
token_const.go
Package-Level Type Names (only one)
Token is the set of lexical tokens in JavaScript (ECMA5).
String returns the string corresponding to the token.
For operators, delimiters, and keywords the string is the actual
token string (e.g., for the token PLUS, the String() is
"+"). For all other tokens the string corresponds to the token
name (e.g. for the token IDENTIFIER, the string is "IDENTIFIER").
Token : expvar.Var
Token : fmt.Stringer
func IsKeyword(literal string) (Token, bool)
func IsId(tkn Token) bool
func IsUnreservedWord(tkn Token) bool
const ADD_ASSIGN
const AND
const AND_ASSIGN
const ARROW
const ASSIGN
const ASYNC
const AWAIT
const BACKTICK
const BITWISE_NOT
const BOOLEAN
const BREAK
const CASE
const CATCH
const CLASS
const COALESCE
const COLON
const COMMA
const COMMENT
const CONST
const CONTINUE
const DEBUGGER
const DECREMENT
const DEFAULT
const DELETE
const DO
const ELLIPSIS
const ELSE
const EOF
const EQUAL
const ESCAPED_RESERVED_WORD
const EXCLUSIVE_OR
const EXCLUSIVE_OR_ASSIGN
const EXPONENT
const EXPONENT_ASSIGN
const EXTENDS
const FINALLY
const FOR
const FUNCTION
const GREATER
const GREATER_OR_EQUAL
const IDENTIFIER
const IF
const ILLEGAL
const IN
const INCREMENT
const INSTANCEOF
const KEYWORD
const LEFT_BRACE
const LEFT_BRACKET
const LEFT_PARENTHESIS
const LESS
const LESS_OR_EQUAL
const LET
const LOGICAL_AND
const LOGICAL_OR
const MINUS
const MULTIPLY
const MULTIPLY_ASSIGN
const NEW
const NOT
const NOT_EQUAL
const NULL
const NUMBER
const OF
const OR
const OR_ASSIGN
const PERIOD
const PLUS
const PRIVATE_IDENTIFIER
const QUESTION_DOT
const QUESTION_MARK
const QUOTIENT_ASSIGN
const REMAINDER
const REMAINDER_ASSIGN
const RETURN
const RIGHT_BRACE
const RIGHT_BRACKET
const RIGHT_PARENTHESIS
const SEMICOLON
const SHIFT_LEFT
const SHIFT_LEFT_ASSIGN
const SHIFT_RIGHT
const SHIFT_RIGHT_ASSIGN
const SLASH
const STATIC
const STRICT_EQUAL
const STRICT_NOT_EQUAL
const STRING
const SUBTRACT_ASSIGN
const SUPER
const SWITCH
const THIS
const THROW
const TRY
const TYPEOF
const UNSIGNED_SHIFT_RIGHT
const UNSIGNED_SHIFT_RIGHT_ASSIGN
const VAR
const VOID
const WHILE
const WITH
const YIELD
Package-Level Functions (total 3)
IsKeyword returns the keyword token if literal is a keyword, a KEYWORD token
if the literal is a future keyword (const, let, class, super, ...), or 0 if the literal is not a keyword.
If the literal is a keyword, IsKeyword returns a second value indicating if the literal
is considered a future keyword in strict-mode only.
7.6.1.2 Future Reserved Words:
const
class
enum
export
extends
import
super
7.6.1.2 Future Reserved Words (strict):
implements
interface
let
package
private
protected
public
static
func IsUnreservedWord(tkn Token) bool
Package-Level Constants (total 102)
const ADD_ASSIGN Token = 18 // += const AND_ASSIGN Token = 24 // &= const BITWISE_NOT Token = 41 // ~ const ESCAPED_RESERVED_WORD Token = 97 const EXCLUSIVE_OR Token = 14 // ^ const EXCLUSIVE_OR_ASSIGN Token = 26 // ^= const EXPONENT_ASSIGN Token = 21 // **= const GREATER_OR_EQUAL Token = 45 // >= const IDENTIFIER Token = 62 const INSTANCEOF Token = 96 const LEFT_BRACE Token = 48 // { const LEFT_BRACKET Token = 47 // [ const LEFT_PARENTHESIS Token = 46 // ( const LESS_OR_EQUAL Token = 44 // <= const LOGICAL_AND Token = 30 // && const LOGICAL_OR Token = 31 // || const MULTIPLY_ASSIGN Token = 20 // *= const PRIVATE_IDENTIFIER Token = 61 const QUESTION_DOT Token = 57 // ?. const QUESTION_MARK Token = 56 // ? const QUOTIENT_ASSIGN Token = 22 // /= const REMAINDER_ASSIGN Token = 23 // %= const RIGHT_BRACE Token = 53 // } const RIGHT_BRACKET Token = 52 // ] const RIGHT_PARENTHESIS Token = 51 // ) const SHIFT_LEFT Token = 15 // << const SHIFT_LEFT_ASSIGN Token = 27 // <<= const SHIFT_RIGHT Token = 16 // >> const SHIFT_RIGHT_ASSIGN Token = 28 // >>= const STRICT_EQUAL Token = 36 // === const STRICT_NOT_EQUAL Token = 43 // !== const SUBTRACT_ASSIGN Token = 19 // -= const UNSIGNED_SHIFT_RIGHT Token = 17 // >>> const UNSIGNED_SHIFT_RIGHT_ASSIGN Token = 29 // >>>=![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |