Versions in this module Expand all Collapse all v1 v1.2.0 Feb 20, 2021 Changes in this version + var Keywords = map[string]TokenType + func AsDecimalLiteral(b []byte) bool + func AsIdentifierName(b []byte) bool + func IsIdentifier(tt TokenType) bool + func IsIdentifierContinue(b []byte) bool + func IsIdentifierEnd(b []byte) bool + func IsIdentifierName(tt TokenType) bool + func IsIdentifierStart(b []byte) bool + func IsNumeric(tt TokenType) bool + func IsOperator(tt TokenType) bool + func IsPunctuator(tt TokenType) bool + func IsReservedWord(tt TokenType) bool + type AST struct + Comments [][]byte + func (ast *AST) String() string + type Alias struct + Binding []byte + Name []byte + func (alias Alias) String() string + type Arg struct + Rest bool + Value IExpr + type Args struct + List []Arg + func (n Args) String() string + type ArrayExpr struct + List []Element + func (n ArrayExpr) String() string + type ArrowFunc struct + Async bool + Body BlockStmt + Params Params + func (n ArrowFunc) String() string + type BinaryExpr struct + Op TokenType + X IExpr + Y IExpr + func (n BinaryExpr) String() string + type BindingArray struct + List []BindingElement + Rest IBinding + func (n BindingArray) String() string + type BindingElement struct + Binding IBinding + Default IExpr + func (n BindingElement) String() string + type BindingObject struct + List []BindingObjectItem + Rest *Var + func (n BindingObject) String() string + type BindingObjectItem struct + Key *PropertyName + Value BindingElement + type BlockStmt struct + List []IStmt + func (n BlockStmt) String() string + type BranchStmt struct + Label []byte + Type TokenType + func (n BranchStmt) String() string + type CallExpr struct + Args Args + X IExpr + func (n CallExpr) String() string + type CaseClause struct + Cond IExpr + List []IStmt + type ClassDecl struct + Extends IExpr + Methods []MethodDecl + Name *Var + func (n ClassDecl) String() string + type CondExpr struct + Cond IExpr + X IExpr + Y IExpr + func (n CondExpr) String() string + type DebuggerStmt struct + func (n DebuggerStmt) String() string + type DeclType uint16 + const ArgumentDecl + const CatchDecl + const ExprDecl + const FunctionDecl + const LexicalDecl + const NoDecl + const VariableDecl + func (decl DeclType) String() string + type DirectivePrologueStmt struct + Value []byte + func (n DirectivePrologueStmt) String() string + type DoWhileStmt struct + Body IStmt + Cond IExpr + func (n DoWhileStmt) String() string + type DotExpr struct + Prec OpPrec + X IExpr + Y LiteralExpr + func (n DotExpr) String() string + type Element struct + Spread bool + Value IExpr + type EmptyStmt struct + func (n EmptyStmt) String() string + type ExportStmt struct + Decl IExpr + Default bool + List []Alias + Module []byte + func (n ExportStmt) String() string + type ExprStmt struct + Value IExpr + func (n ExprStmt) String() string + type ForInStmt struct + Body BlockStmt + Init IExpr + Value IExpr + func (n ForInStmt) String() string + type ForOfStmt struct + Await bool + Body BlockStmt + Init IExpr + Value IExpr + func (n ForOfStmt) String() string + type ForStmt struct + Body BlockStmt + Cond IExpr + Init IExpr + Post IExpr + func (n ForStmt) String() string + type FuncDecl struct + Async bool + Body BlockStmt + Generator bool + Name *Var + Params Params + func (n FuncDecl) String() string + type GroupExpr struct + X IExpr + func (n GroupExpr) String() string + type IBinding interface + String func() string + type IExpr interface + String func() string + type IStmt interface + String func() string + type IfStmt struct + Body IStmt + Cond IExpr + Else IStmt + func (n IfStmt) String() string + type ImportMetaExpr struct + func (n ImportMetaExpr) String() string + type ImportStmt struct + Default []byte + List []Alias + Module []byte + func (n ImportStmt) String() string + type IndexExpr struct + Prec OpPrec + X IExpr + Y IExpr + func (n IndexExpr) String() string + type LabelledStmt struct + Label []byte + Value IStmt + func (n LabelledStmt) String() string + type Lexer struct + func NewLexer(r io.Reader) *Lexer + func (l *Lexer) Err() error + func (l *Lexer) Next() (TokenType, []byte) + func (l *Lexer) RegExp() (TokenType, []byte) + type LiteralExpr struct + Data []byte + func (n LiteralExpr) String() string + type MethodDecl struct + Async bool + Body BlockStmt + Generator bool + Get bool + Name PropertyName + Params Params + Set bool + Static bool + func (n MethodDecl) String() string + type NewExpr struct + Args *Args + X IExpr + func (n NewExpr) String() string + type NewTargetExpr struct + func (n NewTargetExpr) String() string + type ObjectExpr struct + List []Property + func (n ObjectExpr) String() string + type OpPrec int + const OpAdd + const OpAnd + const OpAssign + const OpBitAnd + const OpBitOr + const OpBitXor + const OpCall + const OpCoalesce + const OpCompare + const OpEquals + const OpExp + const OpExpr + const OpLHS + const OpMember + const OpMul + const OpNew + const OpOr + const OpPrimary + const OpShift + const OpUnary + const OpUpdate + func (prec OpPrec) String() string + type OptChainExpr struct + X IExpr + Y IExpr + func (n OptChainExpr) String() string + type Params struct + List []BindingElement + Rest IBinding + func (n Params) String() string + type Property struct + Init IExpr + Name *PropertyName + Spread bool + Value IExpr + func (n Property) String() string + type PropertyName struct + Computed IExpr + Literal LiteralExpr + func (n PropertyName) IsComputed() bool + func (n PropertyName) IsIdent(data []byte) bool + func (n PropertyName) IsSet() bool + func (n PropertyName) String() string + type ReturnStmt struct + Value IExpr + func (n ReturnStmt) String() string + type Scope struct + Declared VarArray + Func *Scope + HasWith bool + IsGlobalOrFunc bool + NumArguments uint16 + NumForInit uint16 + NumVarDecls uint16 + Parent *Scope + Undeclared VarArray + func (s *Scope) Declare(decl DeclType, name []byte) (*Var, bool) + func (s *Scope) HoistUndeclared() + func (s *Scope) MarkArguments() + func (s *Scope) MarkForInit() + func (s *Scope) UndeclareScope() + func (s *Scope) Use(name []byte) *Var + func (s Scope) String() string + type SwitchStmt struct + Init IExpr + List []CaseClause + func (n SwitchStmt) String() string + type TemplateExpr struct + List []TemplatePart + Prec OpPrec + Tag IExpr + Tail []byte + func (n TemplateExpr) String() string + type TemplatePart struct + Expr IExpr + Value []byte + type ThrowStmt struct + Value IExpr + func (n ThrowStmt) String() string + type TokenType uint16 + const AddEqToken + const AddToken + const AndEqToken + const AndToken + const ArrowToken + const AsToken + const AsyncToken + const AwaitToken + const BigIntToken + const BinaryToken + const BitAndEqToken + const BitAndToken + const BitNotToken + const BitOrEqToken + const BitOrToken + const BitXorEqToken + const BitXorToken + const BreakToken + const CaseToken + const CatchToken + const ClassToken + const CloseBraceToken + const CloseBracketToken + const CloseParenToken + const ColonToken + const CommaToken + const CommentLineTerminatorToken + const CommentToken + const ConstToken + const ContinueToken + const DebuggerToken + const DecimalToken + const DecrToken + const DefaultToken + const DeleteToken + const DivEqToken + const DivToken + const DoToken + const DotToken + const EllipsisToken + const ElseToken + const EnumToken + const EqEqEqToken + const EqEqToken + const EqToken + const ErrorToken + const ExpEqToken + const ExpToken + const ExportToken + const ExtendsToken + const FalseToken + const FinallyToken + const ForToken + const FromToken + const FunctionToken + const GetToken + const GtEqToken + const GtGtEqToken + const GtGtGtEqToken + const GtGtGtToken + const GtGtToken + const GtToken + const HexadecimalToken + const IdentifierToken + const IfToken + const ImplementsToken + const ImportToken + const InToken + const IncrToken + const InstanceofToken + const InterfaceToken + const LetToken + const LineTerminatorToken + const LtEqToken + const LtLtEqToken + const LtLtToken + const LtToken + const MetaToken + const ModEqToken + const ModToken + const MulEqToken + const MulToken + const NegToken + const NewToken + const NotEqEqToken + const NotEqToken + const NotToken + const NullToken + const NullishEqToken + const NullishToken + const NumericToken + const OctalToken + const OfToken + const OpenBraceToken + const OpenBracketToken + const OpenParenToken + const OperatorToken + const OptChainToken + const OrEqToken + const OrToken + const PackageToken + const PosToken + const PostDecrToken + const PostIncrToken + const PreDecrToken + const PreIncrToken + const PrivateToken + const ProtectedToken + const PublicToken + const PunctuatorToken + const QuestionToken + const RegExpToken + const ReservedToken + const ReturnToken + const SemicolonToken + const SetToken + const StaticToken + const StringToken + const SubEqToken + const SubToken + const SuperToken + const SwitchToken + const TargetToken + const TemplateEndToken + const TemplateMiddleToken + const TemplateStartToken + const TemplateToken + const ThisToken + const ThrowToken + const TrueToken + const TryToken + const TypeofToken + const VarToken + const VoidToken + const WhileToken + const WhitespaceToken + const WithToken + const YieldToken + func (tt TokenType) Bytes() []byte + func (tt TokenType) String() string + type TryStmt struct + Binding IBinding + Body BlockStmt + Catch *BlockStmt + Finally *BlockStmt + func (n TryStmt) String() string + type UnaryExpr struct + Op TokenType + X IExpr + func (n UnaryExpr) String() string + type Var struct + Data []byte + Decl DeclType + Link *Var + Uses uint16 + func (v *Var) Name() []byte + func (v *Var) String() string + type VarArray []*Var + func (vs VarArray) String() string + type VarDecl struct + List []BindingElement + func (n VarDecl) String() string + type VarsByUses VarArray + func (vs VarsByUses) Len() int + func (vs VarsByUses) Less(i, j int) bool + func (vs VarsByUses) Swap(i, j int) + type WhileStmt struct + Body IStmt + Cond IExpr + func (n WhileStmt) String() string + type WithStmt struct + Body IStmt + Cond IExpr + func (n WithStmt) String() string + type YieldExpr struct + Generator bool + X IExpr + func (n YieldExpr) String() string