package js_lexer
Import Path
github.com/evanw/esbuild/internal/js_lexer (on go.dev)
Dependency Relation
imports 8 packages, and imported by 6 packages
Involved Source Files
js_lexer.go
tables.go
This file was automatically generated by gen-unicode-table.js. Do not edit.
Package-Level Type Names (total 6, in which 3 are exported)
AllOriginalComments []js_ast.Comment
ApproximateNewlineCount int
CommentsToPreserveBefore []js_ast.Comment
HasNewlineBefore bool
HasPureCommentBefore bool
Identifier string
IsLegacyOctalLiteral bool
The log is disabled during speculative scans that may backtrack
JSXFactoryPragmaComment js_ast.Span
JSXFragmentPragmaComment js_ast.Span
LegacyOctalLoc logger.Loc
Number float64
PreserveAllCommentsBefore bool
SourceMappingURL js_ast.Span
StringLiteral []uint16
Token T
codePoint rune
current int
end int
forGlobalName bool
json json
log logger.Log
prevErrorLoc logger.Loc
rescanCloseBraceAsTemplateToken bool
source logger.Source
start int
(*T) Expect(token T)
(*T) ExpectContextualKeyword(text string)
This parses a single ">" token. If that is the first part of a longer token,
this function splits off the first ">" and leaves the remainder of the
current token as another, smaller token. For example, ">>=" becomes ">=".
(*T) ExpectInsideJSXElement(token T)
(*T) ExpectJSXElementChild(token T)
This parses a single "<" token. If that is the first part of a longer token,
this function splits off the first "<" and leaves the remainder of the
current token as another, smaller token. For example, "<<=" becomes "<=".
(*T) ExpectOrInsertSemicolon()
(*T) Expected(token T)
(*T) ExpectedString(text string)
(*T) IsContextualKeyword(text string) bool
(*T) IsIdentifierOrKeyword() bool
(*T) Loc() logger.Loc
(*T) Next()
(*T) NextInsideJSXElement()
(*T) NextJSXElementChild()
(*T) Range() logger.Range
(*T) Raw() string
(*T) RawTemplateContents() string
(*T) RescanCloseBraceAsTemplateToken()
(*T) ScanRegExp()
(*T) SyntaxError()
(*T) Unexpected()
(*T) addError(loc logger.Loc, text string)
(*T) addErrorWithNotes(loc logger.Loc, text string, notes []logger.MsgData)
(*T) addRangeError(r logger.Range, text string)
(*T) decodeEscapeSequences(start int, text string) []uint16
(*T) parseNumericLiteralOrDot()
(*T) scanCommentText()
This is an edge case that doesn't really exist in the wild, so it doesn't
need to be as fast as possible.
(*T) step()
func NewLexer(log logger.Log, source logger.Source) Lexer
func NewLexerGlobalName(log logger.Log, source logger.Source) Lexer
func NewLexerJSON(log logger.Log, source logger.Source, allowComments bool) Lexer
func github.com/evanw/esbuild/internal/js_parser.newParser(log logger.Log, source logger.Source, lexer Lexer, options *js_parser.Options) *js_parser.parser
type LexerPanic (struct)
( T) IsAssign() bool
func (*Lexer).scanIdentifierWithEscapes(kind identifierKind) (string, T)
func (*Lexer).Expect(token T)
func (*Lexer).Expected(token T)
func (*Lexer).ExpectInsideJSXElement(token T)
func (*Lexer).ExpectJSXElementChild(token T)
const TAmpersand
const TAmpersandAmpersand
const TAmpersandAmpersandEquals
const TAmpersandEquals
const TAsterisk
const TAsteriskAsterisk
const TAsteriskAsteriskEquals
const TAsteriskEquals
const TAt
const TBar
const TBarBar
const TBarBarEquals
const TBarEquals
const TBigIntegerLiteral
const TBreak
const TCaret
const TCaretEquals
const TCase
const TCatch
const TClass
const TCloseBrace
const TCloseBracket
const TCloseParen
const TColon
const TComma
const TConst
const TContinue
const TDebugger
const TDefault
const TDelete
const TDo
const TDot
const TDotDotDot
const TElse
const TEndOfFile
const TEnum
const TEquals
const TEqualsEquals
const TEqualsEqualsEquals
const TEqualsGreaterThan
const TEscapedKeyword
const TExclamation
const TExclamationEquals
const TExclamationEqualsEquals
const TExport
const TExtends
const TFalse
const TFinally
const TFor
const TFunction
const TGreaterThan
const TGreaterThanEquals
const TGreaterThanGreaterThan
const TGreaterThanGreaterThanEquals
const TGreaterThanGreaterThanGreaterThan
const TGreaterThanGreaterThanGreaterThanEquals
const THashbang
const TIdentifier
const TIf
const TImport
const TIn
const TInstanceof
const TLessThan
const TLessThanEquals
const TLessThanLessThan
const TLessThanLessThanEquals
const TMinus
const TMinusEquals
const TMinusMinus
const TNew
const TNoSubstitutionTemplateLiteral
const TNull
const TNumericLiteral
const TOpenBrace
const TOpenBracket
const TOpenParen
const TPercent
const TPercentEquals
const TPlus
const TPlusEquals
const TPlusPlus
const TPrivateIdentifier
const TQuestion
const TQuestionDot
const TQuestionQuestion
const TQuestionQuestionEquals
const TReturn
const TSemicolon
const TSlash
const TSlashEquals
const TStringLiteral
const TSuper
const TSwitch
const TSyntaxError
const TTemplateHead
const TTemplateMiddle
const TTemplateTail
const TThis
const TThrow
const TTilde
const TTrue
const TTry
const TTypeof
const TVar
const TVoid
const TWhile
const TWith
Package-Level Functions (total 23, in which 17 are exported)
This does "ContainsNonBMPCodePoint(UTF16ToString(text))" without any allocations
This is a clone of "utf8.DecodeRuneInString" that has been modified to
decode using WTF-8 instead. See https://simonsapin.github.io/wtf-8/ for
more info.
func ForceValidIdentifier(text string) string func IsIdentifier(text string) bool func IsIdentifierContinue(codePoint rune) bool func IsIdentifierStart(codePoint rune) bool
This does "IsIdentifier(UTF16ToString(text))" without any allocations
See the "White Space Code Points" table in the ECMAScript standard
func StringToUTF16(text string) []uint16
Does "UTF16ToString(text) == str" without a temporary allocation
func UTF16EqualsUTF16(a []uint16, b []uint16) bool func UTF16ToString(text []uint16) string
Package-Level Variables (total 6, in which 2 are exported)
Package-Level Constants (total 111, in which 107 are exported)
Punctuation
If you add a new token, remember to add it to "tokenToString" too
Assignments (keep in sync with IsAssign() below)
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
Reserved words
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
"#!/usr/bin/env node"
Identifiers
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
Literals
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
Class-private fields and methods
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
Pseudo-literals
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
If you add a new token, remember to add it to "tokenToString" too
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin 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 @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |