package lexer
import "github.com/evanw/esbuild/internal/lexer"
This file was automatically generated by gen-unicode-table.js. Do not edit.
Index ¶
- func AppendUTF16ToBytes(bytes []byte, text []uint16) []byte
- func DecodeWTF8Rune(s string) (rune, int)
- func IsIdentifier(text string) bool
- func IsIdentifierContinue(codePoint rune) bool
- func IsIdentifierStart(codePoint rune) bool
- func IsIdentifierUTF16(text []uint16) bool
- func IsWhitespace(codePoint rune) bool
- func Keywords() map[string]T
- func NumberToMinifiedName(i int) string
- func RangeOfIdentifier(source logging.Source, loc ast.Loc) ast.Range
- func StringToUTF16(text string) []uint16
- func UTF16EqualsString(text []uint16, str string) bool
- func UTF16ToString(text []uint16) string
- type Comment
- type Lexer
- func NewLexer(log logging.Log, source logging.Source) Lexer
- func NewLexerJSON(log logging.Log, source logging.Source, allowComments bool) Lexer
- func (lexer *Lexer) Expect(token T)
- func (lexer *Lexer) ExpectContextualKeyword(text string)
- func (lexer *Lexer) ExpectGreaterThan(isInsideJSXElement bool)
- func (lexer *Lexer) ExpectInsideJSXElement(token T)
- func (lexer *Lexer) ExpectJSXElementChild(token T)
- func (lexer *Lexer) ExpectLessThan(isInsideJSXElement bool)
- func (lexer *Lexer) ExpectOrInsertSemicolon()
- func (lexer *Lexer) Expected(token T)
- func (lexer *Lexer) ExpectedString(text string)
- func (lexer *Lexer) IsContextualKeyword(text string) bool
- func (lexer *Lexer) IsIdentifierOrKeyword() bool
- func (lexer *Lexer) Loc() ast.Loc
- func (lexer *Lexer) Next()
- func (lexer *Lexer) NextInsideJSXElement()
- func (lexer *Lexer) NextJSXElementChild()
- func (lexer *Lexer) Range() ast.Range
- func (lexer *Lexer) Raw() string
- func (lexer *Lexer) RawTemplateContents() string
- func (lexer *Lexer) RescanCloseBraceAsTemplateToken()
- func (lexer *Lexer) ScanRegExp()
- func (lexer *Lexer) SyntaxError()
- func (lexer *Lexer) Unexpected()
- type LexerPanic
- type T
Functions ¶
func AppendUTF16ToBytes ¶
Does "append(bytes, UTF16ToString(text))" without a temporary allocation
func DecodeWTF8Rune ¶
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 IsIdentifier ¶
func IsIdentifierContinue ¶
func IsIdentifierStart ¶
func IsIdentifierUTF16 ¶
This does "IsIdentifier(UTF16ToString(text))" without any allocations
func IsWhitespace ¶
See the "White Space Code Points" table in the ECMAScript standard
func Keywords ¶
func NumberToMinifiedName ¶
func RangeOfIdentifier ¶
func StringToUTF16 ¶
func UTF16EqualsString ¶
Does "UTF16ToString(text) == str" without a temporary allocation
func UTF16ToString ¶
Types ¶
type Comment ¶
type Lexer ¶
type Lexer struct { Token T HasNewlineBefore bool HasPureCommentBefore bool CommentsToPreserveBefore []Comment StringLiteral []uint16 Identifier string JSXFactoryPragmaComment ast.Span JSXFragmentPragmaComment ast.Span SourceMappingURL ast.Span Number float64 // The log is disabled during speculative scans that may backtrack IsLogDisabled bool // contains filtered or unexported fields }
func NewLexer ¶
func NewLexerJSON ¶
func (*Lexer) Expect ¶
func (*Lexer) ExpectContextualKeyword ¶
func (*Lexer) ExpectGreaterThan ¶
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 ">=".
func (*Lexer) ExpectInsideJSXElement ¶
func (*Lexer) ExpectJSXElementChild ¶
func (*Lexer) ExpectLessThan ¶
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 "<=".
func (*Lexer) ExpectOrInsertSemicolon ¶
func (lexer *Lexer) ExpectOrInsertSemicolon()
func (*Lexer) Expected ¶
func (*Lexer) ExpectedString ¶
func (*Lexer) IsContextualKeyword ¶
func (*Lexer) IsIdentifierOrKeyword ¶
func (*Lexer) Loc ¶
func (*Lexer) Next ¶
func (lexer *Lexer) Next()
func (*Lexer) NextInsideJSXElement ¶
func (lexer *Lexer) NextInsideJSXElement()
func (*Lexer) NextJSXElementChild ¶
func (lexer *Lexer) NextJSXElementChild()
func (*Lexer) Range ¶
func (*Lexer) Raw ¶
func (*Lexer) RawTemplateContents ¶
func (*Lexer) RescanCloseBraceAsTemplateToken ¶
func (lexer *Lexer) RescanCloseBraceAsTemplateToken()
func (*Lexer) ScanRegExp ¶
func (lexer *Lexer) ScanRegExp()
func (*Lexer) SyntaxError ¶
func (lexer *Lexer) SyntaxError()
func (*Lexer) Unexpected ¶
func (lexer *Lexer) Unexpected()
type LexerPanic ¶
type LexerPanic struct{}
type T ¶
type T uint
const ( TEndOfFile T = iota TSyntaxError // "#!/usr/bin/env node" THashbang // Literals TNoSubstitutionTemplateLiteral // Contents are in lexer.StringLiteral ([]uint16) TNumericLiteral // Contents are in lexer.Number (float64) TStringLiteral // Contents are in lexer.StringLiteral ([]uint16) TBigIntegerLiteral // Contents are in lexer.Identifier (string) // Pseudo-literals TTemplateHead // Contents are in lexer.StringLiteral ([]uint16) TTemplateMiddle // Contents are in lexer.StringLiteral ([]uint16) TTemplateTail // Contents are in lexer.StringLiteral ([]uint16) // Punctuation TAmpersand TAmpersandAmpersand TAsterisk TAsteriskAsterisk TAt TBar TBarBar TCaret TCloseBrace TCloseBracket TCloseParen TColon TComma TDot TDotDotDot TEqualsEquals TEqualsEqualsEquals TEqualsGreaterThan TExclamation TExclamationEquals TExclamationEqualsEquals TGreaterThan TGreaterThanEquals TGreaterThanGreaterThan TGreaterThanGreaterThanGreaterThan TLessThan TLessThanEquals TLessThanLessThan TMinus TMinusMinus TOpenBrace TOpenBracket TOpenParen TPercent TPlus TPlusPlus TQuestion TQuestionDot TQuestionQuestion TSemicolon TSlash TTilde // Assignments TAmpersandAmpersandEquals TAmpersandEquals TAsteriskAsteriskEquals TAsteriskEquals TBarBarEquals TBarEquals TCaretEquals TEquals TGreaterThanGreaterThanEquals TGreaterThanGreaterThanGreaterThanEquals TLessThanLessThanEquals TMinusEquals TPercentEquals TPlusEquals TQuestionQuestionEquals TSlashEquals // Class-private fields and methods TPrivateIdentifier // Identifiers TIdentifier // Contents are in lexer.Identifier (string) TEscapedKeyword // A keyword that has been escaped as an identifer // Reserved words TBreak TCase TCatch TClass TConst TContinue TDebugger TDefault TDelete TDo TElse TEnum TExport TExtends TFalse TFinally TFor TFunction TIf TImport TIn TInstanceof TNew TNull TReturn TSuper TSwitch TThis TThrow TTrue TTry TTypeof TVar TVoid TWhile TWith // Strict mode reserved words TImplements TInterface TLet TPackage TPrivate TProtected TPublic TStatic TYield )
If you add a new token, remember to add it to "tokenToString" too
Source Files ¶
- Version
- v0.6.5
- Published
- Jul 20, 2020
- Platform
- windows/amd64
- Imports
- 8 packages
- Last checked
- 4 hours ago –
Tools for package owners.