parser

package
v0.0.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERR_UNEXPECTED_CHAR                            = "Unexpected character"
	ERR_UNEXPECTED_TOKEN                           = "Unexpected token"
	ERR_TPL_UNEXPECTED_TOKEN_TYPE                  = "Unexpected token `%s`"
	ERR_UNTERMINATED_COMMENT                       = "Unterminated comment"
	ERR_UNTERMINATED_REGEXP                        = "Unterminated regular expression"
	ERR_UNTERMINATED_STR                           = "Unterminated string constant"
	ERR_INVALID_REGEXP_FLAG                        = "Invalid regular expression flag"
	ERR_IDENT_AFTER_NUMBER                         = "Identifier directly after number"
	ERR_INVALID_NUMBER                             = "Invalid number"
	ERR_TPL_EXPECT_NUM_RADIX                       = "Expected number in radix %s"
	ERR_LEGACY_OCTAL_IN_STRICT_MODE                = "Octal literals are not allowed in strict mode"
	ERR_TPL_LEGACY_OCTAL_ESCAPE_IN                 = "Octal escape sequences are not allowed in template strings"
	ERR_LEGACY_OCTAL_ESCAPE_IN_STRICT_MODE         = "Octal escape sequences are not allowed in strict mode"
	ERR_EXPECTING_UNICODE_ESCAPE                   = "Expecting Unicode escape sequence \\uXXXX"
	ERR_CODEPOINT_OUT_OF_BOUNDS                    = "Code point out of bounds"
	ERR_BAD_ESCAPE_SEQ                             = "Bad character escape sequence"
	ERR_BAD_RUNE                                   = "Bad character"
	ERR_UNTERMINATED_TPL                           = "Unterminated template"
	ERR_INVALID_UNICODE_ESCAPE                     = "Invalid Unicode escape"
	ERR_ILLEGAL_RETURN                             = "Illegal return"
	ERR_ILLEGAL_BREAK                              = "Illegal break"
	ERR_DUP_LABEL                                  = "Label `%s` already declared"
	ERR_UNDEF_LABEL                                = "Undefined label `%s`"
	ERR_ILLEGAL_CONTINUE                           = "Illegal continue"
	ERR_MULTI_DEFAULT                              = "Multiple default clauses"
	ERR_ASSIGN_TO_RVALUE                           = "Assigning to rvalue"
	ERR_INVALID_META_PROP                          = "The only valid meta property for new is `new.target`"
	ERR_META_PROP_OUTSIDE_FN                       = "`new.target` can only be used in functions"
	ERR_DUP_BINDING                                = "Must have a single binding"
	ERR_TPL_BINDING_RESERVED_WORD                  = "Invalid binding `%s`"
	ERR_AWAIT_AS_DEFAULT_VALUE                     = "Await expression cannot be a default value"
	ERR_AWAIT_IN_FORMAL_PARAMS                     = "Await expression can't be used in parameter"
	ERR_TPL_ASSIGN_TO_RESERVED_WORD_IN_STRICT_MODE = "Assigning to `%s` in strict mode"
	ERR_FOR_IN_LOOP_HAS_INIT                       = "for-in loop variable declaration may not have an initializer"
	ERR_FOR_OF_LOOP_HAS_INIT                       = "for-of loop variable declaration may not have an initializer"
	ERR_STRICT_DIRECTIVE_AFTER_NOT_SIMPLE          = "Illegal 'use strict' directive in function with non-simple parameter list"
	ERR_DUP_PARAM_NAME                             = "Parameter name clash"
	ERR_TRAILING_COMMA                             = "Unexpected trailing comma"
	ERR_REST_ELEM_MUST_LAST                        = "Rest element must be last element"
	ERR_DELETE_LOCAL_IN_STRICT                     = "Deleting local variable in strict mode"
	ERR_REDEF_PROP                                 = "Redefinition of property"
	ERR_ILLEGAL_NEWLINE_AFTER_THROW                = "Illegal newline after throw"
	ERR_CONST_DEC_INIT_REQUIRED                    = "Const declarations require an initialization value"
	ERR_TPL_FORBIDDEN_LEXICAL_NAME                 = "%s is disallowed as a lexically bound name"
	ERR_GETTER_SHOULD_NO_PARAM                     = "Getter must not have any formal parameters"
	ERR_SETTER_SHOULD_ONE_PARAM                    = "Setter must have exactly one formal parameter"
	ERR_ESCAPE_IN_KEYWORD                          = "Keyword must not contain escaped characters"
	ERR_WITH_STMT_IN_STRICT                        = "Strict mode code may not include a with statement"
	ERR_CLASS_NAME_REQUIRED                        = "Class name is required"
	ERR_SHORTHAND_PROP_ASSIGN_NOT_IN_DESTRUCT      = "Shorthand property assignments are valid only in destructuring patterns"
	ERR_REST_ARG_NOT_SIMPLE                        = "Invalid rest operator's argument"
	ERR_REST_ARG_NOT_BINDING_PATTERN               = "Binding pattern is not permitted as rest operator's argument"
	ERR_REST_IN_SETTER                             = "Setter cannot use rest params"
	ERR_INVALID_PAREN_ASSIGN_PATTERN               = "Invalid parenthesized assignment pattern"
	ERR_OBJ_PATTERN_CANNOT_FN                      = "Object pattern can't contain getter or setter"
	ERR_INVALID_DESTRUCTING_TARGET                 = "Invalid destructuring assignment target"
	ERR_REST_CANNOT_SET_DEFAULT                    = "Rest elements cannot have a default value"
	ERR_MALFORMED_ARROW_PARAM                      = "Malformed arrow function parameter list"
	ERR_AWAIT_OUTSIDE_ASYNC                        = "Cannot use keyword 'await' outside an async function"
	ERR_AWAIT_AS_NAME_IN_ASYNC                     = "Can not use 'await' as identifier inside an async function"
	ERR_EXPORT_NOT_DEFINED                         = "Export `%s` is not defined"
	ERR_DUP_EXPORT                                 = "Duplicate export `%s`"
	ERR_FN_IN_SINGLE_STMT_CTX                      = "function declarations can't appear in single-statement context"
	ERR_STATIC_PROP_PROTOTYPE                      = "Classes can't have a static field named `prototype`"
	ERR_YIELD_CANNOT_BE_DEFAULT_VALUE              = "Yield expression cannot be a default value"
	ERR_YIELD_IN_FORMAL_PARAMS                     = "Yield expression can't be used in parameter"
	ERR_SUPER_CALL_OUTSIDE_CTOR                    = "super() call outside constructor of a subclass"
	ERR_SUPER_OUTSIDE_CLASS                        = "'super' is only allowed in object methods and classes"
	ERR_CTOR_CANNOT_HAVE_MODIFIER                  = "Constructor can't have get/set modifier"
	ERR_CTOR_CANNOT_BE_GENERATOR                   = "Constructor can't be a generator"
	ERR_CTOR_CANNOT_BE_ASYNC                       = "Constructor can't be a async"
	ERR_CTOR_CANNOT_BE_Field                       = "Classes can't have a field named `constructor`"
	ERR_CTOR_DUP                                   = "Duplicate constructor in the same class"
	ERR_COMPUTE_PROP_MISSING_INIT                  = "A computed property name must have property initialization"
	ERR_IMPORT_EXPORT_SHOULD_AT_TOP_LEVEL          = "'import' and 'export' may only appear at the top level"
	ERR_COMPLEX_BINDING_MISSING_INIT               = "Complex binding patterns require an initialization value"
	ERR_LHS_OF_FOR_OF_CANNOT_ASYNC                 = "The left-hand side of a for-of loop may not be 'async'"
	ERR_TPL_UNARY_IMMEDIATELY_BEFORE_POW           = "Unary operator `%s` used immediately before exponentiation expression"
	ERR_TPL_ID_DUP_DEF                             = "Identifier `%s` has already been declared"
	ERR_UNEXPECTED_PVT_FIELD                       = "Unexpected private field"
	ERR_DELETE_PVT_FIELD                           = "Private fields can not be deleted"
	ERR_TPL_ALONE_PVT_FIELD                        = "Private field `%s` must be declared in an enclosing class"
	ERR_OPT_EXPR_IN_NEW                            = "Invalid optional chain from new expression"
	ERR_OPT_EXPR_IN_TAG                            = "Invalid tagged template on optional chain"
	ERR_NULLISH_MIXED_WITH_LOGIC                   = "Cannot use unparenthesized `??` within logic expressions"
	ERR_NUM_SEP_BEGIN                              = "Numeric separator is not allowed at the first of digits"
	ERR_NUM_SEP_END                                = "Numeric separator is not allowed at the last of digits"
	ERR_NUM_SEP_DUP                                = "Only one underscore is allowed as numeric separator"
	ERR_NUM_SEP_IN_LEGACY_OCTAL                    = "Numeric separator is not allowed in legacy octal numeric literals"
	ERR_ILLEGAL_IMPORT_PROP                        = "The only valid meta property for import is `import.meta`"
	ERR_META_PROP_CONTAINS_ESCAPE                  = "Meta property can not contain escaped characters"
	ERR_DYNAMIC_IMPORT_CANNOT_NEW                  = "Cannot use new with `import()`"
	ERR_DECORATOR_INVALID_POSITION                 = "Leading decorators must be attached to a class declaration"

	// JSX related errors
	ERR_UNTERMINATED_JSX_CONTENTS           = "Unterminated JSX contents"
	ERR_TPL_UNBALANCED_JSX_TAG              = "Expected corresponding JSX closing tag for <%s>"
	ERR_JSX_ADJACENT_ELEM_SHOULD_BE_WRAPPED = "Adjacent JSX elements must be wrapped in an enclosing tag"
	ERR_TPL_JSX_HTML_UNESCAPED_ENTITY       = "Unexpected `%s`, HTML entity "
	ERR_TPL_JSX_UNDEFINED_HTML_ENTITY       = "Undefined HTML entity `%s`"

	// TS related errors
	ERR_THIS_CANNOT_BE_OPTIONAL                = "The `this` parameter cannot be optional"
	ERR_ILLEGAL_PARAMETER_MODIFIER             = "A parameter property is only allowed in a constructor implementation"
	ERR_CTOR_CANNOT_WITH_TYPE_PARAMS           = "Type parameters cannot appear on a constructor declaration"
	ERR_FN_SIG_MISSING_IMPL                    = "Function implementation is missing or not immediately following the declaration"
	ERR_TPL_INVALID_FN_IMPL_NAME               = "Function implementation name must be `%s`"
	ERR_TPL_USE_TYP_AS_VALUE                   = "`%s` only refers to a type, but is being used as a value here"
	ERR_ASYNC_IN_AMBIENT                       = "`async` modifier cannot be used in an ambient context"
	ERR_INIT_IN_ALLOWED_CTX                    = "Initializers are not allowed in ambient contexts"
	ERR_IMPL_IN_AMBIENT_CTX                    = "An implementation cannot be declared in ambient contexts"
	ERR_UNEXPECTED_TYPE_ANNOTATION             = "Unexpected type annotation"
	ERR_ABSTRACT_MIXED_WITH_STATIC             = "`static` modifier cannot be used with `abstract` modifier"
	ERR_DECLARE_MIXED_WITH_OVERRIDE            = "`declare` modifier cannot be used with `override` modifier"
	ERR_BARE_ABSTRACT_PROPERTY                 = "Abstract methods can only appear within an abstract class"
	ERR_ABSTRACT_METHOD_WITH_IMPL              = "Method cannot have an implementation because it's marked abstract"
	ERR_ABSTRACT_PROP_WITH_INIT                = "Property cannot have an initializer because it's marked abstract"
	ERR_OVERRIDE_METHOD_DYNAMIC_NAME           = "Method overload name must refer to an expression whose type is a literal type or a `unique symbol` type"
	ERR_TPL_INVALID_MODIFIER_ORDER             = "`%s` modifier must precede `%s` modifier"
	ERR_ILLEGAL_DECLARE_IN_CLASS               = "`declare` modifier cannot appear on class elements of this kind"
	ERR_EMPTY_TYPE_PARAM_LIST                  = "Type parameter list cannot be empty"
	ERR_EXTEND_LIST_EMPTY                      = "`extends` list cannot be empty"
	ERR_IMPLEMENT_LIST_EMPTY                   = "`implements` list cannot be empty"
	ERR_METHOD_CANNOT_READONLY                 = "Class methods cannot have the `readonly` modifier"
	ERR_TPL_IDX_SIG_CANNOT_HAVE_MODIFIER       = "Index signatures cannot have the `%s` modifier"
	ERR_TPL_IDX_SIG_CANNOT_HAVE_ACCESS         = "Index signatures cannot have an accessibility modifier `%s`"
	ERR_OVERRIDE_ON_CTOR                       = "`override` modifier cannot appear on a constructor declaration"
	ERR_OVERRIDE_IN_NO_EXTEND                  = "This member cannot have an `override` modifier because its containing class does not extend another class"
	ERR_PARAM_PROP_WITH_BINDING_PATTERN        = "A parameter property may not be declared using a binding pattern"
	ERR_PVT_ELEM_WITH_ABSTRACT                 = "Private elements cannot have the `abstract` modifier"
	ERR_TPL_PVT_ELEM_WITH_ACCESS_MODIFIER      = "Private elements cannot have an accessibility modifier `%s`"
	ERR_JSX_TS_LT_AMBIGUITY                    = "This syntax is reserved in `JSX`. Use an `as` expression instead"
	ERR_EXPORT_DECLARE_MISSING_DECLARATION     = "`declare` must be followed by an ambient declaration"
	ERR_GETTER_SETTER_WITH_THIS_PARAM          = "`get` and `set` accessors cannot declare `this` parameters"
	ERR_BINDING_PATTERN_REQUIRE_IN_IMPL        = "A binding pattern parameter cannot be optional in an implementation signature"
	ERR_IMPORT_REQUIRE_STR_LIT_DESERVED        = "String literal expected"
	ERR_IMPORT_TYPE_IN_IMPORT_ALIAS            = "An import alias can not use `import type`"
	ERR_ABSTRACT_AT_INVALID_POSITION           = "`abstract` modifier can only appear on a class, method, or property declaration"
	ERR_ACCESSOR_WITH_TYPE_PARAMS              = "An accessor cannot have type parameters"
	ERR_GETTER_WITH_PARAMS                     = "A `get` accessor cannot have parameters"
	ERR_SETTER_WITH_PARAM_OPTIONAL             = "A `set` accessor cannot have an optional parameter"
	ERR_SETTER_MISSING_PARAM                   = "A `set` accessor must have exactly one parameter"
	ERR_SETTER_WITH_REST_PARAM                 = "A `set` accessor cannot have rest parameter"
	ERR_SETTER_WITH_RET_TYP                    = "A `set` accessor cannot have a return type annotation"
	ERR_TPL_MODIFIER_ON_TYPE_MEMBER            = "`%s` modifier cannot appear on a type member"
	ERR_ONLY_AMBIENT_MOD_WITH_STR_NAME         = "Only ambient modules can use quoted names"
	ERR_STATIC_BLOCK_WITH_MODIFIER             = "Static class blocks cannot have any modifier"
	ERR_TYPE_ARG_EMPTY                         = "Type argument list cannot be empty"
	ERR_EXPORT_DUP_TYPE_MODIFIER               = "The `type` modifier cannot be used on a named export when `export type` is used on its export statement"
	ERR_IMPORT_TYP_MIX_NAMED                   = "A type-only import can specify a default import or named bindings, but not both"
	ERR_IMPORT_ARG_SHOULD_BE_STR               = "Argument in a type import must be a string literal"
	ERR_INVALID_RO_MODIFIER_IN_TS_OBJ          = "`readonly` modifier can only appear on a property declaration or index signature"
	ERR_READONLY_ONLY_PERMITTED_ON_ARRAY_TUPLE = "`readonly` type modifier is only permitted on array and tuple literal types"
	ERR_REST_TYPE_SHOULD_BE_ARRAY              = "A rest element type must be an array type"
	ERR_TUPLE_NAMED_SHOULD_ALL_NAMED           = "Tuple members must all have names or all not have names"
	ERR_TUPLE_LABEL_SHOULD_BE_SIMPLE           = "Tuple members must be labeled with a simple identifier"
	ERR_TUPLE_OPT_SHOULD_AFTER_REQUIRED        = "A required element cannot follow an optional element"
)
View Source
const TOKENS_BUF_LEN = 5

Variables

View Source
var CtxKeywords = make(map[string]TokenValue)
View Source
var HTMLEntities = map[string]HTMLEntity{}/* 2125 elements not displayed */
View Source
var HTMLEntityNames = map[string]bool{}/* 1511 elements not displayed */
View Source
var Keywords = make(map[string]TokenValue)
View Source
var MaxHTMLEntityName int = 33
View Source
var StrictKeywords = make(map[string]TokenValue)
View Source
var TokenKinds = [T_TOKEN_DEF_END + 1]*TokenKind{}/* 141 elements not displayed */

order should be as same as `TokenValue`

Functions

func CheckRefDup

func CheckRefDup(r1, r2 *Ref) bool

caller should ensure both `r1` and `r2` have the same name

func IsBothEnum

func IsBothEnum(r1, r2 *Ref) bool

caller should ensure both `r1` and `r2` match below rules: - are def rather than ref - have the same name

this method is used to allow stmts:

``` const enum Foo {} const enum Foo {} ```

func IsBothFnTypDec

func IsBothFnTypDec(r1, r2 *Ref) bool

caller should ensure both `r1` and `r2` match below rules: - are def rather than ref - have the same name

this method is used to allow stmts:

``` declare function f(): void; declare function f<T>(): T; ```

func IsBothItf

func IsBothItf(r1, r2 *Ref) bool

caller should ensure both `r1` and `r2` match below rules: - are def rather than ref - have the same name

this method is used to allow stmts:

``` interface A {} interface A {} ```

func IsBothTyp

func IsBothTyp(r1, r2 *Ref) bool

caller should ensure both `r1` and `r2` match below rules: - are def rather than ref - have the same name

func IsBothVal

func IsBothVal(r1, r2 *Ref) bool

caller should ensure both `r1` and `r2` match below rules: - be def rather than ref - have the same name

func IsCallableClass

func IsCallableClass(r1, r2 *Ref) bool

caller should ensure both `r1` and `r2` match below rules: - are def rather than ref - have the same name

this method is used to allow stmts:

``` declare class C { } function C() { } ```

func IsClsAndIft

func IsClsAndIft(r1, r2 *Ref) bool

caller should ensure both `r1` and `r2` match below rules: - are def rather than ref - have the same name

this method is used to allow stmts:

``` class A {} interface A {} ```

func IsCtxKeyword

func IsCtxKeyword(str string) bool

func IsDecimalDigit

func IsDecimalDigit(c rune) bool

func IsEnumAndVal

func IsEnumAndVal(r1, r2 *Ref) bool

func IsHexDigit

func IsHexDigit(c rune) bool

func IsIdPart

func IsIdPart(c rune) bool

func IsIdStart

func IsIdStart(c rune) bool

func IsKeyword

func IsKeyword(str string) bool

func IsName

func IsName(tok *Token, name string, canContainsEscape bool) bool

func IsNodeInParen added in v0.0.10

func IsNodeInParen(node Node) bool

func IsOctalDigit

func IsOctalDigit(c rune) bool

func IsOneOfNs added in v0.0.10

func IsOneOfNs(r1, r2 *Ref) bool

func IsSingleEscapeChar

func IsSingleEscapeChar(c rune) bool

func IsStrictKeyword

func IsStrictKeyword(str string) bool

func NodeIsBigint added in v0.0.10

func NodeIsBigint(node Node, s *span.Source) bool

func NodeText added in v0.0.10

func NodeText(node Node, s *span.Source) string

func NodeToFloat added in v0.0.10

func NodeToFloat(node Node, s *span.Source) float64

func ParseBigint added in v0.0.10

func ParseBigint(t string) *big.Int

func ParseFloat added in v0.0.10

func ParseFloat(t string) float64

func TokRawText added in v0.0.10

func TokRawText(t *Token, s *span.Source) string

func TokText added in v0.0.10

func TokText(t *Token, s *span.Source) string

Types

type ACC_MOD

type ACC_MOD uint8
const (
	ACC_MOD_NONE ACC_MOD = iota
	ACC_MOD_PUB
	ACC_MOD_PRI
	ACC_MOD_PRO
)

func (ACC_MOD) String

func (a ACC_MOD) String() string

type ArrLit

type ArrLit struct {
	// contains filtered or unexported fields
}

#[visitor(Elems)]

func (*ArrLit) Elems

func (n *ArrLit) Elems() []Node

func (*ArrLit) OuterParen

func (n *ArrLit) OuterParen() span.Range

func (*ArrLit) Range added in v0.0.10

func (n *ArrLit) Range() span.Range

func (*ArrLit) SetOuterParen

func (n *ArrLit) SetOuterParen(rng span.Range)

func (*ArrLit) SetTypInfo

func (n *ArrLit) SetTypInfo(ti *TypInfo)

func (*ArrLit) TypInfo

func (n *ArrLit) TypInfo() *TypInfo

func (*ArrLit) Type

func (n *ArrLit) Type() NodeType

type ArrPat

type ArrPat struct {
	// contains filtered or unexported fields
}

#[visitor(Elems)]

func (*ArrPat) Elems

func (n *ArrPat) Elems() []Node

func (*ArrPat) OuterParen

func (n *ArrPat) OuterParen() span.Range

func (*ArrPat) Range added in v0.0.10

func (n *ArrPat) Range() span.Range

func (*ArrPat) SetOuterParen

func (n *ArrPat) SetOuterParen(rng span.Range)

func (*ArrPat) SetTypInfo

func (n *ArrPat) SetTypInfo(ti *TypInfo)

func (*ArrPat) TypInfo

func (n *ArrPat) TypInfo() *TypInfo

func (*ArrPat) Type

func (n *ArrPat) Type() NodeType

type ArrowFn

type ArrowFn struct {
	// contains filtered or unexported fields
}

#[visitor(PUSH_SCOPE,Params,Body)]

func (*ArrowFn) Async

func (n *ArrowFn) Async() bool

func (*ArrowFn) Body

func (n *ArrowFn) Body() Node

func (*ArrowFn) ExpRet

func (n *ArrowFn) ExpRet() bool

func (*ArrowFn) Expr

func (n *ArrowFn) Expr() bool

func (*ArrowFn) OuterParen

func (n *ArrowFn) OuterParen() span.Range

func (*ArrowFn) Params

func (n *ArrowFn) Params() []Node

func (*ArrowFn) Range added in v0.0.10

func (n *ArrowFn) Range() span.Range

func (*ArrowFn) Rets

func (n *ArrowFn) Rets() []Node

func (*ArrowFn) SetOuterParen

func (n *ArrowFn) SetOuterParen(rng span.Range)

func (*ArrowFn) SetTypInfo

func (n *ArrowFn) SetTypInfo(ti *TypInfo)

func (*ArrowFn) TypInfo

func (n *ArrowFn) TypInfo() *TypInfo

func (*ArrowFn) Type

func (n *ArrowFn) Type() NodeType

type AssignExpr

type AssignExpr struct {
	// contains filtered or unexported fields
}

#[visitor(Lhs,Rhs)]

func (*AssignExpr) Lhs

func (n *AssignExpr) Lhs() Node

func (*AssignExpr) Op

func (n *AssignExpr) Op() TokenValue

func (*AssignExpr) OpName added in v0.0.10

func (n *AssignExpr) OpName() string

func (*AssignExpr) OuterParen

func (n *AssignExpr) OuterParen() span.Range

func (*AssignExpr) Range added in v0.0.10

func (n *AssignExpr) Range() span.Range

func (*AssignExpr) Rhs

func (n *AssignExpr) Rhs() Node

func (*AssignExpr) SetOuterParen

func (n *AssignExpr) SetOuterParen(rng span.Range)

func (*AssignExpr) SetTypInfo

func (n *AssignExpr) SetTypInfo(ti *TypInfo)

func (*AssignExpr) TypInfo

func (n *AssignExpr) TypInfo() *TypInfo

func (*AssignExpr) Type

func (n *AssignExpr) Type() NodeType

type AssignPat

type AssignPat struct {
	// contains filtered or unexported fields
}

#[visitor(Lhs,Rhs)]

func (*AssignPat) Lhs

func (n *AssignPat) Lhs() Node

func (*AssignPat) OuterParen

func (n *AssignPat) OuterParen() span.Range

func (*AssignPat) Range added in v0.0.10

func (n *AssignPat) Range() span.Range

func (*AssignPat) Rhs

func (n *AssignPat) Rhs() Node

func (*AssignPat) SetTypInfo

func (n *AssignPat) SetTypInfo(ti *TypInfo)

func (*AssignPat) TypInfo

func (n *AssignPat) TypInfo() *TypInfo

func (*AssignPat) Type

func (n *AssignPat) Type() NodeType

type BinExpr

type BinExpr struct {
	// contains filtered or unexported fields
}

#[visitor(Lhs,Rhs)]

func (*BinExpr) Lhs

func (n *BinExpr) Lhs() Node

func (*BinExpr) Op

func (n *BinExpr) Op() TokenValue

func (*BinExpr) OpText

func (n *BinExpr) OpText() string

func (*BinExpr) OuterParen

func (n *BinExpr) OuterParen() span.Range

func (*BinExpr) Range added in v0.0.10

func (n *BinExpr) Range() span.Range

func (*BinExpr) Rhs

func (n *BinExpr) Rhs() Node

func (*BinExpr) SetOuterParen

func (n *BinExpr) SetOuterParen(rng span.Range)

func (*BinExpr) Type

func (n *BinExpr) Type() NodeType

type BindKind

type BindKind uint8
const (
	BK_NONE BindKind = iota
	BK_VAR
	BK_PARAM
	BK_LET
	BK_CONST
	BK_PVT_FIELD
)

type BlockStmt

type BlockStmt struct {
	// contains filtered or unexported fields
}

#[visitor(PUSH_SCOPE,Body)]

func (*BlockStmt) Body

func (n *BlockStmt) Body() []Node

func (*BlockStmt) NewScope

func (n *BlockStmt) NewScope() bool

func (*BlockStmt) Range added in v0.0.10

func (n *BlockStmt) Range() span.Range

func (*BlockStmt) Type

func (n *BlockStmt) Type() NodeType

type BoolLit

type BoolLit struct {
	// contains filtered or unexported fields
}

func (*BoolLit) OuterParen

func (n *BoolLit) OuterParen() span.Range

func (*BoolLit) Range added in v0.0.10

func (n *BoolLit) Range() span.Range

func (*BoolLit) SetOuterParen

func (n *BoolLit) SetOuterParen(rng span.Range)

func (*BoolLit) SetTypInfo

func (n *BoolLit) SetTypInfo(ti *TypInfo)

func (*BoolLit) TypInfo

func (n *BoolLit) TypInfo() *TypInfo

func (*BoolLit) Type

func (n *BoolLit) Type() NodeType

func (*BoolLit) Val

func (n *BoolLit) Val() bool

type BrkStmt

type BrkStmt struct {
	// contains filtered or unexported fields
}

#[visitor(Label)]

func (*BrkStmt) Label

func (n *BrkStmt) Label() Node

func (*BrkStmt) Range added in v0.0.10

func (n *BrkStmt) Range() span.Range

func (*BrkStmt) Target

func (n *BrkStmt) Target() Node

func (*BrkStmt) Type

func (n *BrkStmt) Type() NodeType

type CallExpr

type CallExpr struct {
	// contains filtered or unexported fields
}

#[visitor(Callee,Args)]

func (*CallExpr) Args

func (n *CallExpr) Args() []Node

func (*CallExpr) Callee

func (n *CallExpr) Callee() Node

func (*CallExpr) Optional

func (n *CallExpr) Optional() bool

func (*CallExpr) OuterParen

func (n *CallExpr) OuterParen() span.Range

func (*CallExpr) Range added in v0.0.10

func (n *CallExpr) Range() span.Range

func (*CallExpr) SetOuterParen

func (n *CallExpr) SetOuterParen(rng span.Range)

func (*CallExpr) SetTypInfo

func (n *CallExpr) SetTypInfo(ti *TypInfo)

func (*CallExpr) TypInfo

func (n *CallExpr) TypInfo() *TypInfo

func (*CallExpr) Type

func (n *CallExpr) Type() NodeType

type Catch

type Catch struct {
	// contains filtered or unexported fields
}

#[visitor(PUSH_SCOPE,Param,Body)]

func (*Catch) Body

func (n *Catch) Body() Node

func (*Catch) Param

func (n *Catch) Param() Node

func (*Catch) Range added in v0.0.10

func (n *Catch) Range() span.Range

func (*Catch) Type

func (n *Catch) Type() NodeType

type ChainExpr

type ChainExpr struct {
	// contains filtered or unexported fields
}

#[visitor(Expr)]

func (*ChainExpr) Expr

func (n *ChainExpr) Expr() Node

func (*ChainExpr) Range added in v0.0.10

func (n *ChainExpr) Range() span.Range

func (*ChainExpr) Type

func (n *ChainExpr) Type() NodeType

type ClassBody

type ClassBody struct {
	// contains filtered or unexported fields
}

#[visitor(PUSH_SCOPE,Elems)]

func (*ClassBody) Elems

func (n *ClassBody) Elems() []Node

func (*ClassBody) Range added in v0.0.10

func (n *ClassBody) Range() span.Range

func (*ClassBody) Type

func (n *ClassBody) Type() NodeType

type ClassDec

type ClassDec struct {
	// contains filtered or unexported fields
}

#[visitor(Id,Super,Body)]

func (*ClassDec) Abstract

func (n *ClassDec) Abstract() bool

func (*ClassDec) Body

func (n *ClassDec) Body() Node

func (*ClassDec) Declare

func (n *ClassDec) Declare() bool

func (*ClassDec) Id

func (n *ClassDec) Id() Node

func (*ClassDec) Implements

func (n *ClassDec) Implements() []Node

ClassDec

func (*ClassDec) Range added in v0.0.10

func (n *ClassDec) Range() span.Range

func (*ClassDec) SetTypInfo

func (n *ClassDec) SetTypInfo(ti *TypInfo)

func (*ClassDec) Super

func (n *ClassDec) Super() Node

func (*ClassDec) SuperTypArgs

func (n *ClassDec) SuperTypArgs() Node

func (*ClassDec) TypInfo

func (n *ClassDec) TypInfo() *TypInfo

func (*ClassDec) TypParams

func (n *ClassDec) TypParams() Node

func (*ClassDec) Type

func (n *ClassDec) Type() NodeType

type ClsTypInfo

type ClsTypInfo struct {
	// contains filtered or unexported fields
}

type CondExpr

type CondExpr struct {
	// contains filtered or unexported fields
}

#[visitor(Test,Cons,Alt)]

func (*CondExpr) Alt

func (n *CondExpr) Alt() Node

func (*CondExpr) Cons

func (n *CondExpr) Cons() Node

func (*CondExpr) OuterParen

func (n *CondExpr) OuterParen() span.Range

func (*CondExpr) Range added in v0.0.10

func (n *CondExpr) Range() span.Range

func (*CondExpr) SetOuterParen

func (n *CondExpr) SetOuterParen(rng span.Range)

func (*CondExpr) Test

func (n *CondExpr) Test() Node

func (*CondExpr) Type

func (n *CondExpr) Type() NodeType

type ContStmt

type ContStmt struct {
	// contains filtered or unexported fields
}

#[visitor(Label)]

func (*ContStmt) Label

func (n *ContStmt) Label() Node

func (*ContStmt) Range added in v0.0.10

func (n *ContStmt) Range() span.Range

func (*ContStmt) Target

func (n *ContStmt) Target() Node

func (*ContStmt) Type

func (n *ContStmt) Type() NodeType

type DebugStmt

type DebugStmt struct {
	// contains filtered or unexported fields
}

func (*DebugStmt) Range added in v0.0.10

func (n *DebugStmt) Range() span.Range

func (*DebugStmt) Type

func (n *DebugStmt) Type() NodeType

type Decorator

type Decorator struct {
	// contains filtered or unexported fields
}

#[visitor(Expr)]

func (*Decorator) Expr

func (n *Decorator) Expr() Node

func (*Decorator) Range added in v0.0.10

func (n *Decorator) Range() span.Range

func (*Decorator) Type

func (n *Decorator) Type() NodeType

type DoWhileStmt

type DoWhileStmt struct {
	// contains filtered or unexported fields
}

#[visitor(PUSH_SCOPE,Body,Test)]

func (*DoWhileStmt) Body

func (n *DoWhileStmt) Body() Node

func (*DoWhileStmt) Range added in v0.0.10

func (n *DoWhileStmt) Range() span.Range

func (*DoWhileStmt) Test

func (n *DoWhileStmt) Test() Node

func (*DoWhileStmt) Type

func (n *DoWhileStmt) Type() NodeType

type EmptyStmt

type EmptyStmt struct {
	// contains filtered or unexported fields
}

func (*EmptyStmt) Range added in v0.0.10

func (n *EmptyStmt) Range() span.Range

func (*EmptyStmt) Type

func (n *EmptyStmt) Type() NodeType

type ErrTypArgMissingGT

type ErrTypArgMissingGT struct {
	// contains filtered or unexported fields
}

indicates the closing `>` is missing, so the processed `<` should be considered as the LessThan operator. produced in `tsTypArgs`

func (ErrTypArgMissingGT) Error

func (e ErrTypArgMissingGT) Error() string

type ExportDec

type ExportDec struct {
	// contains filtered or unexported fields
}

#[visitor(Dec,Specs,Src)]

func (*ExportDec) All

func (n *ExportDec) All() bool

func (*ExportDec) Dec

func (n *ExportDec) Dec() Node

func (*ExportDec) Default

func (n *ExportDec) Default() bool

func (*ExportDec) Kind

func (n *ExportDec) Kind() string

func (*ExportDec) Range added in v0.0.10

func (n *ExportDec) Range() span.Range

func (*ExportDec) Specs

func (n *ExportDec) Specs() []Node

func (*ExportDec) Src

func (n *ExportDec) Src() Node

func (*ExportDec) TsTyp

func (n *ExportDec) TsTyp() bool

func (*ExportDec) Type

func (n *ExportDec) Type() NodeType

type ExportSpec

type ExportSpec struct {
	// contains filtered or unexported fields
}

#[visitor(Local,Id)]

func (*ExportSpec) Id

func (n *ExportSpec) Id() Node

func (*ExportSpec) Kind

func (n *ExportSpec) Kind() string

func (*ExportSpec) Local

func (n *ExportSpec) Local() Node

func (*ExportSpec) NameSpace

func (n *ExportSpec) NameSpace() bool

func (*ExportSpec) Range added in v0.0.10

func (n *ExportSpec) Range() span.Range

func (*ExportSpec) TsTyp

func (n *ExportSpec) TsTyp() bool

func (*ExportSpec) Type

func (n *ExportSpec) Type() NodeType

type ExprStmt

type ExprStmt struct {
	// contains filtered or unexported fields
}

#[visitor(Expr)]

func (*ExprStmt) Dir

func (n *ExprStmt) Dir() bool

func (*ExprStmt) Expr

func (n *ExprStmt) Expr() Node

func (*ExprStmt) Range added in v0.0.10

func (n *ExprStmt) Range() span.Range

func (*ExprStmt) Type

func (n *ExprStmt) Type() NodeType

type Feature

type Feature uint64
const (
	FEAT_NONE   Feature = 0
	FEAT_STRICT Feature = 1 << iota
	FEAT_GLOBAL_ASYNC
	FEAT_LET_CONST         // from es6
	FEAT_SPREAD            // from es6
	FEAT_BINDING_PATTERN   // from es6
	FEAT_BINDING_REST_ELEM // from es6
	FEAT_MODULE            // from es6
	FEAT_IMPORT_DEC        // from es6
	FEAT_EXPORT_DEC        // from es6
	FEAT_META_PROPERTY     // from es6

	FEAT_POW                      // from es7
	FEAT_BINDING_REST_ELEM_NESTED // from es7

	FEAT_ASYNC_AWAIT // from es8

	FEAT_BAD_ESCAPE_IN_TAGGED_TPL // from es9
	FEAT_ASYNC_GENERATOR          // from es9
	FEAT_ASYNC_ITERATION          // from es9

	FEAT_OPT_CATCH_PARAM // from es10
	FEAT_JSON_SUPER_SET  // from es10

	FEAT_CLASS_PRV        // from es11
	FEAT_OPT_EXPR         // from es11
	FEAT_NULLISH          // from es11
	FEAT_BIGINT           // from es11
	FEAT_DYNAMIC_IMPORT   // from es11
	FEAT_EXPORT_ALL_AS_NS // from es11

	FEAT_NUM_SEP      // from es12
	FEAT_LOGIC_ASSIGN // from es12

	FEAT_CLASS_PUB_FIELD  // from es13
	FEAT_CLASS_PRIV_FIELD // from es13

	FEAT_JSX
	FEAT_JSX_NS

	// not found where in the spec says that the flags of regexp is needed to check
	// even though it's implemented in some other parsers, so flag `FEAT_CHK_REGEXP_FLAGS`
	// is opt-in in mole
	FEAT_CHK_REGEXP_FLAGS
	FEAT_REGEXP_UNICODE     // from es6
	FEAT_REGEXP_STICKY      // from es6
	FEAT_REGEXP_DOT_ALL     // from es8
	FEAT_REGEXP_HAS_INDICES // from es10

	FEAT_TS
	FEAT_DTS

	FEAT_DECORATOR
)

func (Feature) Off

func (f Feature) Off(flag Feature) Feature

func (Feature) On

func (f Feature) On(flag Feature) Feature

func (Feature) Turn

func (f Feature) Turn(flag Feature, on bool) Feature

type Field

type Field struct {
	// contains filtered or unexported fields
}

#[visitor(Key,Val)]

func (*Field) Computed

func (n *Field) Computed() bool

func (*Field) IsTsSig

func (n *Field) IsTsSig() bool

Field

func (*Field) Key

func (n *Field) Key() Node

func (*Field) Range added in v0.0.10

func (n *Field) Range() span.Range

func (*Field) SetTypInfo

func (n *Field) SetTypInfo(ti *TypInfo)

func (*Field) Static

func (n *Field) Static() bool

func (*Field) TypInfo

func (n *Field) TypInfo() *TypInfo

func (*Field) Type

func (n *Field) Type() NodeType

func (*Field) Val

func (n *Field) Val() Node

type FixedOfstErr added in v0.0.10

type FixedOfstErr struct {
	// contains filtered or unexported fields
}

type FnDec

type FnDec struct {
	// contains filtered or unexported fields
}

#[visitor(Id,PUSH_SCOPE,Params,Body)]

func (*FnDec) Async

func (n *FnDec) Async() bool

func (*FnDec) Body

func (n *FnDec) Body() Node

func (*FnDec) ExpRet

func (n *FnDec) ExpRet() bool

func (*FnDec) Generator

func (n *FnDec) Generator() bool

func (*FnDec) Id

func (n *FnDec) Id() Node

func (*FnDec) IsSig

func (n *FnDec) IsSig() bool

func (*FnDec) OuterParen

func (n *FnDec) OuterParen() span.Range

func (*FnDec) Params

func (n *FnDec) Params() []Node

func (*FnDec) Range added in v0.0.10

func (n *FnDec) Range() span.Range

func (*FnDec) Rets

func (n *FnDec) Rets() []Node

func (*FnDec) SetOuterParen

func (n *FnDec) SetOuterParen(rng span.Range)

func (*FnDec) SetTypInfo

func (n *FnDec) SetTypInfo(ti *TypInfo)

func (*FnDec) TypInfo

func (n *FnDec) TypInfo() *TypInfo

func (*FnDec) Type

func (n *FnDec) Type() NodeType

type ForInOfStmt

type ForInOfStmt struct {
	// contains filtered or unexported fields
}

#[visitor(Left,Right,Body)]

func (*ForInOfStmt) Await

func (n *ForInOfStmt) Await() bool

func (*ForInOfStmt) Body

func (n *ForInOfStmt) Body() Node

func (*ForInOfStmt) In

func (n *ForInOfStmt) In() bool

func (*ForInOfStmt) Left

func (n *ForInOfStmt) Left() Node

func (*ForInOfStmt) Range added in v0.0.10

func (n *ForInOfStmt) Range() span.Range

func (*ForInOfStmt) Right

func (n *ForInOfStmt) Right() Node

func (*ForInOfStmt) Type

func (n *ForInOfStmt) Type() NodeType

type ForStmt

type ForStmt struct {
	// contains filtered or unexported fields
}

#[visitor(PUSH_SCOPE,Init,Test,Update,Body)]

func (*ForStmt) Body

func (n *ForStmt) Body() Node

func (*ForStmt) Init

func (n *ForStmt) Init() Node

func (*ForStmt) Range added in v0.0.10

func (n *ForStmt) Range() span.Range

func (*ForStmt) Test

func (n *ForStmt) Test() Node

func (*ForStmt) Type

func (n *ForStmt) Type() NodeType

func (*ForStmt) Update

func (n *ForStmt) Update() Node

type HTMLEntity

type HTMLEntity struct {
	Name       string
	CodePoints []rune
	Bytes      []byte
}

type Ident

type Ident struct {
	// contains filtered or unexported fields
}

func (*Ident) ContainsEscape

func (n *Ident) ContainsEscape() bool

func (*Ident) IsPrivate

func (n *Ident) IsPrivate() bool

func (*Ident) OuterParen

func (n *Ident) OuterParen() span.Range

func (*Ident) Range added in v0.0.10

func (n *Ident) Range() span.Range

func (*Ident) SetOuterParen

func (n *Ident) SetOuterParen(rng span.Range)

func (*Ident) SetTypInfo

func (n *Ident) SetTypInfo(ti *TypInfo)

func (*Ident) TypInfo

func (n *Ident) TypInfo() *TypInfo

func (*Ident) Type

func (n *Ident) Type() NodeType

func (*Ident) Val added in v0.0.10

func (n *Ident) Val() string

type IfStmt

type IfStmt struct {
	// contains filtered or unexported fields
}

#[visitor(Test,Cons,Alt)]

func (*IfStmt) Alt

func (n *IfStmt) Alt() Node

func (*IfStmt) Cons

func (n *IfStmt) Cons() Node

func (*IfStmt) Range added in v0.0.10

func (n *IfStmt) Range() span.Range

func (*IfStmt) Test

func (n *IfStmt) Test() Node

func (*IfStmt) Type

func (n *IfStmt) Type() NodeType

type IllegalEscapeInfo

type IllegalEscapeInfo struct {
	Err string
	Rng span.Range
}

type ImportCall

type ImportCall struct {
	// contains filtered or unexported fields
}

#[visitor(Src)]

func (*ImportCall) OuterParen

func (n *ImportCall) OuterParen() span.Range

func (*ImportCall) Range added in v0.0.10

func (n *ImportCall) Range() span.Range

func (*ImportCall) SetOuterParen

func (n *ImportCall) SetOuterParen(rng span.Range)

func (*ImportCall) Src

func (n *ImportCall) Src() Node

func (*ImportCall) Type

func (n *ImportCall) Type() NodeType

type ImportDec

type ImportDec struct {
	// contains filtered or unexported fields
}

#[visitor(Specs,Src)]

func (*ImportDec) Kind

func (n *ImportDec) Kind() string

func (*ImportDec) Range added in v0.0.10

func (n *ImportDec) Range() span.Range

func (*ImportDec) Specs

func (n *ImportDec) Specs() []Node

func (*ImportDec) Src

func (n *ImportDec) Src() Node

func (*ImportDec) TsTyp

func (n *ImportDec) TsTyp() bool

func (*ImportDec) Type

func (n *ImportDec) Type() NodeType

type ImportSpec

type ImportSpec struct {
	// contains filtered or unexported fields
}

#[visitor(Local,Id)]

func (*ImportSpec) Default

func (n *ImportSpec) Default() bool

func (*ImportSpec) Id

func (n *ImportSpec) Id() Node

func (*ImportSpec) Kind

func (n *ImportSpec) Kind() string

func (*ImportSpec) Local

func (n *ImportSpec) Local() Node

func (*ImportSpec) NameSpace

func (n *ImportSpec) NameSpace() bool

func (*ImportSpec) Range added in v0.0.10

func (n *ImportSpec) Range() span.Range

func (*ImportSpec) TsTyp

func (n *ImportSpec) TsTyp() bool

func (*ImportSpec) Type

func (n *ImportSpec) Type() NodeType

type InParenNode

type InParenNode interface {
	OuterParen() span.Range
	SetOuterParen(span.Range)
}

type JsxAttr

type JsxAttr struct {
	// contains filtered or unexported fields
}

#[visitor(Name,Val)]

func (*JsxAttr) Name

func (n *JsxAttr) Name() Node

func (*JsxAttr) NameStr

func (n *JsxAttr) NameStr() string

func (*JsxAttr) Range added in v0.0.10

func (n *JsxAttr) Range() span.Range

func (*JsxAttr) Type

func (n *JsxAttr) Type() NodeType

func (*JsxAttr) Val

func (n *JsxAttr) Val() Node

type JsxClose

type JsxClose struct {
	// contains filtered or unexported fields
}

#[visitor(Name)]

func (*JsxClose) Name

func (n *JsxClose) Name() Node

func (*JsxClose) Range added in v0.0.10

func (n *JsxClose) Range() span.Range

func (*JsxClose) Type

func (n *JsxClose) Type() NodeType

type JsxElem

type JsxElem struct {
	// contains filtered or unexported fields
}

https://github.com/facebook/jsx/blob/main/AST.md#jsx-element

#[visitor(Open,Children,Close)]

func (*JsxElem) Children

func (n *JsxElem) Children() []Node

func (*JsxElem) Close

func (n *JsxElem) Close() Node

func (*JsxElem) IsFragment

func (n *JsxElem) IsFragment() bool

func (*JsxElem) Open

func (n *JsxElem) Open() Node

func (*JsxElem) Range added in v0.0.10

func (n *JsxElem) Range() span.Range

func (*JsxElem) Type

func (n *JsxElem) Type() NodeType

type JsxEmpty

type JsxEmpty struct {
	// contains filtered or unexported fields
}

func (*JsxEmpty) Range added in v0.0.10

func (n *JsxEmpty) Range() span.Range

func (*JsxEmpty) Type

func (n *JsxEmpty) Type() NodeType

type JsxExprSpan

type JsxExprSpan struct {
	// contains filtered or unexported fields
}

#[visitor(Expr)]

func (*JsxExprSpan) Expr

func (n *JsxExprSpan) Expr() Node

func (*JsxExprSpan) Range added in v0.0.10

func (n *JsxExprSpan) Range() span.Range

func (*JsxExprSpan) Type

func (n *JsxExprSpan) Type() NodeType

type JsxIdent

type JsxIdent struct {
	// contains filtered or unexported fields
}

func (*JsxIdent) OuterParen

func (n *JsxIdent) OuterParen() span.Range

func (*JsxIdent) Range added in v0.0.10

func (n *JsxIdent) Range() span.Range

func (*JsxIdent) SetOuterParen

func (n *JsxIdent) SetOuterParen(rng span.Range)

func (*JsxIdent) SetTypInfo

func (n *JsxIdent) SetTypInfo(ti *TypInfo)

func (*JsxIdent) TypInfo

func (n *JsxIdent) TypInfo() *TypInfo

func (*JsxIdent) Type

func (n *JsxIdent) Type() NodeType

func (*JsxIdent) Val added in v0.0.10

func (n *JsxIdent) Val() string

type JsxMember

type JsxMember struct {
	// contains filtered or unexported fields
}

#[visitor(Obj,Prop)]

func (*JsxMember) Obj

func (n *JsxMember) Obj() Node

func (*JsxMember) Prop

func (n *JsxMember) Prop() Node

func (*JsxMember) Range added in v0.0.10

func (n *JsxMember) Range() span.Range

func (*JsxMember) SetTypInfo

func (n *JsxMember) SetTypInfo(ti *TypInfo)

func (*JsxMember) TypInfo

func (n *JsxMember) TypInfo() *TypInfo

func (*JsxMember) Type

func (n *JsxMember) Type() NodeType

type JsxNsName

type JsxNsName struct {
	// contains filtered or unexported fields
}

func (*JsxNsName) NS

func (n *JsxNsName) NS() string

func (*JsxNsName) Name

func (n *JsxNsName) Name() string

func (*JsxNsName) Range added in v0.0.10

func (n *JsxNsName) Range() span.Range

func (*JsxNsName) Type

func (n *JsxNsName) Type() NodeType

type JsxOpen

type JsxOpen struct {
	// contains filtered or unexported fields
}

#[visitor(Name,Attrs)]

func (*JsxOpen) Attrs

func (n *JsxOpen) Attrs() []Node

func (*JsxOpen) Closed

func (n *JsxOpen) Closed() bool

func (*JsxOpen) Name

func (n *JsxOpen) Name() Node

func (*JsxOpen) Range added in v0.0.10

func (n *JsxOpen) Range() span.Range

func (*JsxOpen) Type

func (n *JsxOpen) Type() NodeType

type JsxSpreadAttr

type JsxSpreadAttr struct {
	// contains filtered or unexported fields
}

#[visitor(Arg)]

func (*JsxSpreadAttr) Arg

func (n *JsxSpreadAttr) Arg() Node

func (*JsxSpreadAttr) Range added in v0.0.10

func (n *JsxSpreadAttr) Range() span.Range

func (*JsxSpreadAttr) Type

func (n *JsxSpreadAttr) Type() NodeType

type JsxSpreadChild

type JsxSpreadChild struct {
	// contains filtered or unexported fields
}

#[visitor(Expr)]

func (*JsxSpreadChild) Expr

func (n *JsxSpreadChild) Expr() Node

func (*JsxSpreadChild) Range added in v0.0.10

func (n *JsxSpreadChild) Range() span.Range

func (*JsxSpreadChild) Type

func (n *JsxSpreadChild) Type() NodeType

type JsxText

type JsxText struct {
	// contains filtered or unexported fields
}

func (*JsxText) Range added in v0.0.10

func (n *JsxText) Range() span.Range

func (*JsxText) Type

func (n *JsxText) Type() NodeType

func (*JsxText) Val

func (n *JsxText) Val() string

type LabelStmt

type LabelStmt struct {
	// contains filtered or unexported fields
}

#[visitor(Label,Body)]

func (*LabelStmt) Body

func (n *LabelStmt) Body() Node

func (*LabelStmt) Label

func (n *LabelStmt) Label() Node

func (*LabelStmt) Range added in v0.0.10

func (n *LabelStmt) Range() span.Range

func (*LabelStmt) Type

func (n *LabelStmt) Type() NodeType

func (*LabelStmt) Used

func (n *LabelStmt) Used() bool

type Lexer

type Lexer struct {
	// contains filtered or unexported fields
}

func NewLexer

func NewLexer(src *span.Source) *Lexer

func (*Lexer) AddMode

func (l *Lexer) AddMode(mode LexerModeKind)

func (*Lexer) CurMode

func (l *Lexer) CurMode() *LexerMode

func (*Lexer) DiscardState

func (l *Lexer) DiscardState()

func (*Lexer) EraseMode

func (l *Lexer) EraseMode(mode LexerModeKind)

func (*Lexer) FinRng added in v0.0.10

func (l *Lexer) FinRng(rng span.Range) span.Range

func (*Lexer) IsLineTerminator

func (l *Lexer) IsLineTerminator(c rune) bool

func (*Lexer) IsMode

func (l *Lexer) IsMode(mode LexerModeKind) bool

func (*Lexer) Next

func (l *Lexer) Next() *Token

read a token, named `next` to indicate it will move the cursor

func (*Lexer) NextRevise

func (l *Lexer) NextRevise(v TokenValue) *Token

for tokens like `in` and `of`, they are firstly read as names and then switched to keywords by the parser according to its context, so it's necessary to revise the `prtVal` of lexer to the corresponding of that keywords for satisfying the further lookahead

func (*Lexer) Peek

func (l *Lexer) Peek() *Token

func (*Lexer) Peek2nd

func (l *Lexer) Peek2nd() *Token

guard the peeked buffer has at least 2 tokens, return the 2nd if the guarding is succeeded otherwise return the `EOF_TOK`

func (*Lexer) PeekGrow

func (l *Lexer) PeekGrow() *Token

func (*Lexer) PeekStmtBegin

func (l *Lexer) PeekStmtBegin() *Token

func (*Lexer) PopMode

func (l *Lexer) PopMode() *LexerMode

func (*Lexer) PopState

func (l *Lexer) PopState()

func (*Lexer) PrevTok

func (l *Lexer) PrevTok() TokenValue

func (*Lexer) PrevTokRng added in v0.0.10

func (l *Lexer) PrevTokRng() span.Range

func (*Lexer) PushMode

func (l *Lexer) PushMode(mode LexerModeKind, inherit bool)

func (*Lexer) PushState

func (l *Lexer) PushState()

func (*Lexer) Rng added in v0.0.10

func (l *Lexer) Rng() span.Range

type LexerError

type LexerError struct {
	// contains filtered or unexported fields
}

func (*LexerError) Error

func (e *LexerError) Error() string

type LexerMode

type LexerMode struct {
	// contains filtered or unexported fields
}

type LexerModeKind

type LexerModeKind int
const (
	LM_NONE     LexerModeKind = 0
	LM_STRICT   LexerModeKind = 1 << iota
	LM_TEMPLATE               // for inline spans can tell they are in template string
	LM_TEMPLATE_TAGGED
	LM_ASYNC
	LM_GENERATOR
	LM_CLASS_BODY
	LM_CLASS_CTOR
	LM_NEW
	LM_JSX
	LM_JSX_CHILD
	LM_JSX_ATTR
	LM_TS
	LM_TS_TYP_ARG
)

type LexerState

type LexerState struct {
	// contains filtered or unexported fields
}

consider the ambiguities introduced by TS grammar like `<`:

```ts a < b // binExpr a<b>() // callExpr ```

for dealing with above problem, parser should store its state when the first `<` is met before performing the `argList` processing, the stored state will be restored if the `argList` processing was failed or be discarded if `argList` was succeeded

type MemberExpr

type MemberExpr struct {
	// contains filtered or unexported fields
}

#[visitor(Obj,Prop)]

func (*MemberExpr) Compute

func (n *MemberExpr) Compute() bool

func (*MemberExpr) Obj

func (n *MemberExpr) Obj() Node

func (*MemberExpr) Optional

func (n *MemberExpr) Optional() bool

func (*MemberExpr) OuterParen

func (n *MemberExpr) OuterParen() span.Range

func (*MemberExpr) Prop

func (n *MemberExpr) Prop() Node

func (*MemberExpr) Range added in v0.0.10

func (n *MemberExpr) Range() span.Range

func (*MemberExpr) SetOuterParen

func (n *MemberExpr) SetOuterParen(rng span.Range)

func (*MemberExpr) Type

func (n *MemberExpr) Type() NodeType

type MetaProp

type MetaProp struct {
	// contains filtered or unexported fields
}

#[visitor(Meta,Prop)]

func (*MetaProp) Meta

func (n *MetaProp) Meta() Node

func (*MetaProp) Prop

func (n *MetaProp) Prop() Node

func (*MetaProp) Range added in v0.0.10

func (n *MetaProp) Range() span.Range

func (*MetaProp) Type

func (n *MetaProp) Type() NodeType

type Method

type Method struct {
	// contains filtered or unexported fields
}

#[visitor(Key,Val)]

func (*Method) Computed

func (n *Method) Computed() bool

func (*Method) Declare

func (n *Method) Declare() bool

func (*Method) HasBody

func (n *Method) HasBody() bool

func (*Method) Key

func (n *Method) Key() Node

func (*Method) Kind

func (n *Method) Kind() string

func (*Method) PropKind

func (n *Method) PropKind() PropKind

func (*Method) Range added in v0.0.10

func (n *Method) Range() span.Range

func (*Method) SetTypInfo

func (n *Method) SetTypInfo(ti *TypInfo)

func (*Method) Static

func (n *Method) Static() bool

func (*Method) TypInfo

func (n *Method) TypInfo() *TypInfo

func (*Method) Type

func (n *Method) Type() NodeType

func (*Method) Val

func (n *Method) Val() Node

type ModifierNameLoc

type ModifierNameLoc struct {
	// contains filtered or unexported fields
}

type NewExpr

type NewExpr struct {
	// contains filtered or unexported fields
}

#[visitor(Callee,Args)]

func (*NewExpr) Args

func (n *NewExpr) Args() []Node

func (*NewExpr) Callee

func (n *NewExpr) Callee() Node

func (*NewExpr) OuterParen

func (n *NewExpr) OuterParen() span.Range

func (*NewExpr) Range added in v0.0.10

func (n *NewExpr) Range() span.Range

func (*NewExpr) SetOuterParen

func (n *NewExpr) SetOuterParen(rng span.Range)

func (*NewExpr) SetTypInfo

func (n *NewExpr) SetTypInfo(ti *TypInfo)

func (*NewExpr) TypInfo

func (n *NewExpr) TypInfo() *TypInfo

func (*NewExpr) Type

func (n *NewExpr) Type() NodeType

type Node

type Node interface {
	Type() NodeType
	Range() span.Range
}

AST nodes are referred to [ESTree](https://github.com/estree/estree/blob/master/es5.md) with some variants:

  • flattened struct is used instead of inheritance
  • fields are not fully described as they are claimed in ESTree, eg. the field names in this file are shorter then their equivalent of ESTree. for the requirement what the ESTree compatible output is needed, use the `estree` package to do the transformation

func DecoratorsOf

func DecoratorsOf(node Node) []Node

func UnParen

func UnParen(expr Node) Node

type NodeType

type NodeType uint16
const (
	N_ILLEGAL NodeType = iota
	N_PROG             // #[visitor(Prog)]

	N_STMT_BEGIN
	N_STMT_EMPTY
	N_STMT_EXPR      // #[visitor(ExprStmt)]
	N_STMT_VAR_DEC   // #[visitor(VarDecStmt)]
	N_STMT_FN        // #[visitor(FnDec)]
	N_STMT_BLOCK     // #[visitor(BlockStmt)]
	N_STMT_DO_WHILE  // #[visitor(DoWhileStmt)]
	N_STMT_WHILE     // #[visitor(WhileStmt)]
	N_STMT_FOR       // #[visitor(ForStmt)]
	N_STMT_FOR_IN_OF // #[visitor(ForInOfStmt)]
	N_STMT_IF        // #[visitor(IfStmt)]
	N_STMT_SWITCH    // #[visitor(SwitchStmt)]
	N_STMT_BRK       // #[visitor(BrkStmt)]
	N_STMT_CONT      // #[visitor(ContStmt)]
	N_STMT_LABEL     // #[visitor(LabelStmt)]
	N_STMT_RET       // #[visitor(RetStmt)]
	N_STMT_THROW     // #[visitor(ThrowStmt)]
	N_STMT_TRY       // #[visitor(TryStmt)]
	N_STMT_DEBUG     // #[visitor(DebugStmt)]
	N_STMT_WITH      // #[visitor(WithStmt)]
	N_STMT_CLASS     // #[visitor(ClassDec)]
	N_STMT_IMPORT    // #[visitor(ImportDec)]
	N_STMT_EXPORT    // #[visitor(ExportDec)]
	N_STMT_END

	N_EXPR_BEGIN
	N_LIT_BEGIN
	N_LIT_NULL   // #[visitor(NullLit)]
	N_LIT_BOOL   // #[visitor(BoolLit)]
	N_LIT_NUM    // #[visitor(NumLit)]
	N_LIT_STR    // #[visitor(StrLit)]
	N_LIT_ARR    // #[visitor(ArrLit)]
	N_LIT_OBJ    // #[visitor(ObjLit)]
	N_LIT_REGEXP // #[visitor(RegLit)]
	N_LIT_END

	N_EXPR_NEW    // #[visitor(NewExpr)]
	N_EXPR_MEMBER // #[visitor(MemberExpr)]
	N_EXPR_CALL   // #[visitor(CallExpr)]
	N_EXPR_BIN    // #[visitor(BinExpr)]
	N_EXPR_UNARY  // #[visitor(UnaryExpr)]
	N_EXPR_UPDATE // #[visitor(UpdateExpr)]
	N_EXPR_COND   // #[visitor(CondExpr)]
	N_EXPR_ASSIGN // #[visitor(AssignExpr)]
	N_EXPR_FN     // #[visitor(FnDec)]
	N_EXPR_THIS   // #[visitor(ThisExpr)]
	N_EXPR_PAREN  // #[visitor(ParenExpr)]
	N_EXPR_ARROW  // #[visitor(ArrowFn)]
	N_EXPR_SEQ    // #[visitor(SeqExpr)]
	N_EXPR_CLASS  // #[visitor(ClassDec)]
	N_EXPR_TPL    // #[visitor(TplExpr)]
	N_EXPR_YIELD  // #[visitor(YieldExpr)]
	N_EXPR_CHAIN  // #[visitor(ChainExpr)]
	N_JSX_ELEM    // #[visitor(JsxElem)]
	N_NAME        // #[visitor(Ident)]
	N_IMPORT_CALL // #[visitor(ImportCall)]
	N_META_PROP   // #[visitor(MetaProp)]
	N_DECORATOR   // #[visitor(Decorator)]
	N_SPREAD      // #[visitor(Spread)]
	N_EXPR_END

	N_VAR_DEC      // #[visitor(VarDec)]
	N_PAT_REST     // #[visitor(RestPat)]
	N_PAT_ARRAY    // #[visitor(ArrPat)]
	N_PAT_ASSIGN   // #[visitor(AssignPat)]
	N_PAT_OBJ      // #[visitor(ObjPat)]
	N_PROP         // #[visitor(Prop)]
	N_SWITCH_CASE  // #[visitor(SwitchCase)]
	N_CATCH        // #[visitor(Catch)]
	N_CLASS_BODY   // #[visitor(ClassBody)]
	N_STATIC_BLOCK // #[visitor(StaticBlock)]
	N_METHOD       // #[visitor(Method)]
	N_FIELD        // #[visitor(Field)]
	N_SUPER        // #[visitor(Super)]
	N_IMPORT_SPEC  // #[visitor(ImportSpec)]
	N_EXPORT_SPEC  // #[visitor(ExportSpec)]

	N_JSX_BEGIN
	N_JSX_ID           // #[visitor(JsxIdent)]
	N_JSX_MEMBER       // #[visitor(JsxMember)]
	N_JSX_NS           // #[visitor(JsxNsName)]
	N_JSX_ATTR_SPREAD  // #[visitor(JsxSpreadAttr)]
	N_JSX_CHILD_SPREAD // #[visitor(JsxSpreadChild)]
	N_JSX_OPEN         // #[visitor(JsxOpen)]
	N_JSX_CLOSE        // #[visitor(JsxClose)]
	N_JSX_EMPTY        // #[visitor(JsxEmpty)]
	N_JSX_EXPR_SPAN    // #[visitor(JsxExprSpan)]
	N_JSX_TXT          // #[visitor(JsxText)]
	N_JSX_ATTR         // #[visitor(JsxAttr)]
	N_JSX_END

	N_TS_BEGIN
	N_TS_TYP_ANNOT          // #[visitor(TsTypAnnot)]
	N_TS_ANY                // #[visitor(TsPredef)]
	N_TS_NUM                // #[visitor(TsPredef)]
	N_TS_BOOL               // #[visitor(TsPredef)]
	N_TS_STR                // #[visitor(TsPredef)]
	N_TS_SYM                // #[visitor(TsPredef)]
	N_TS_OBJ                // #[visitor(TsPredef)]
	N_TS_VOID               // #[visitor(TsPredef)]
	N_TS_NEVER              // #[visitor(TsPredef)]
	N_TS_UNKNOWN            // #[visitor(TsPredef)]
	N_TS_UNDEF              // #[visitor(TsPredef)]
	N_TS_BIGINT             // #[visitor(TsPredef)]
	N_TS_INTRINSIC          // #[visitor(TsPredef)]
	N_TS_NULL               // #[visitor(TsPredef)]
	N_TS_LIT                // #[visitor(TsLit)]
	N_TS_REF                // #[visitor(TsRef)]
	N_TS_LIT_OBJ            // #[visitor(TsObj)]
	N_TS_ARR                // #[visitor(TsArr)]
	N_TS_IDX_ACCESS         // #[visitor(TsIdxAccess)]
	N_TS_TUPLE              // #[visitor(TsTuple)]
	N_TS_REST               // #[visitor(TsRest)]
	N_TS_TUPLE_NAMED_MEMBER // #[visitor(TsTupleNamedMember)]
	N_TS_OPT                // #[visitor(TsOpt)]
	N_TS_TYP_QUERY          // #[visitor(TsTypQuery)]
	N_TS_COND               // #[visitor(TsCondType)]
	N_TS_TYP_OP             // #[visitor(TsTypOp)]
	N_TS_MAPPED             // #[visitor(TsMapped)]
	N_TS_TYP_INFER          // #[visitor(TsTypInfer)]
	N_TS_PAREN              // #[visitor(TsParen)]
	N_TS_THIS               // #[visitor(TsThis)]
	N_TS_NS_NAME            // #[visitor(TsNsName)]
	N_TS_PARAM              // #[visitor(TsParam)]
	N_TS_PARAM_DEC          // #[visitor(TsParamsDec)]
	N_TS_PARAM_INST         // #[visitor(TsParamsInst)]
	N_TS_PROP               // #[visitor(TsProp)]
	N_TS_CALL_SIG           // #[visitor(TsCallSig)]
	N_TS_NEW_SIG            // #[visitor(TsNewSig)]
	N_TS_IDX_SIG            // #[visitor(TsIdxSig)]
	N_TS_FN_TYP             // #[visitor(TsFnTyp)]
	N_TS_NEW                // #[visitor(TsNewSig)]
	N_TS_UNION_TYP          // #[visitor(TsUnionTyp)]
	N_TS_INTERSECT_TYP      // #[visitor(TsIntersectTyp)]
	N_TS_ROUGH_PARAM        // #[visitor(TsRoughParam)]
	N_TS_TYP_ASSERT         // #[visitor(TsTypAssert)]
	N_TS_TYP_DEC            // #[visitor(TsTypDec)]
	N_TS_INTERFACE          // #[visitor(TsInterface)]
	N_TS_INTERFACE_BODY     // #[visitor(TsInterfaceBody)]
	N_TS_ENUM               // #[visitor(TsEnum)]
	N_TS_ENUM_MEMBER        // #[visitor(TsEnumMember)]
	N_TS_IMPORT_ALIAS       // #[visitor(TsImportAlias)]
	N_TS_NAMESPACE          // #[visitor(TsNS)]
	N_TS_IMPORT_REQUIRE     // #[visitor(TsImportRequire)]
	N_TS_IMPORT_TYP         // #[visitor(TsImportType)]
	N_TS_EXPORT_ASSIGN      // #[visitor(TsExportAssign)]

	N_TS_DEC_VAR_DEC   // #[visitor(TsDec)]
	N_TS_DEC_FN        // #[visitor(TsDec)]
	N_TS_DEC_ENUM      // #[visitor(TsDec)]
	N_TS_DEC_CLASS     // #[visitor(TsDec)]
	N_TS_DEC_NS        // #[visitor(TsDec)]
	N_TS_DEC_MODULE    // #[visitor(TsDec)]
	N_TS_DEC_GLOBAL    // #[visitor(TsDec)]
	N_TS_DEC_INTERFACE // #[visitor(TsDec)]
	N_TS_DEC_TYP_DEC   // #[visitor(TsDec)]

	N_TS_TYP_PREDICATE // #[visitor(TsTypPredicate)]
	N_TS_NO_NULL       // #[visitor(TsNoNull)]
	N_TS_END

	N_NODE_DEF_END
)

func (NodeType) IsExpr

func (nt NodeType) IsExpr() bool

func (NodeType) IsLit

func (nt NodeType) IsLit() bool

func (NodeType) IsStmt

func (nt NodeType) IsStmt() bool

func (NodeType) String

func (nt NodeType) String() string

type NodeWithTypInfo

type NodeWithTypInfo interface {
	TypInfo() *TypInfo
	SetTypInfo(*TypInfo)
}

type NullLit

type NullLit struct {
	// contains filtered or unexported fields
}

func (*NullLit) Range added in v0.0.10

func (n *NullLit) Range() span.Range

func (*NullLit) SetOuterParen

func (n *NullLit) SetOuterParen(rng span.Range)

func (*NullLit) SetTypInfo

func (n *NullLit) SetTypInfo(ti *TypInfo)

func (*NullLit) TypInfo

func (n *NullLit) TypInfo() *TypInfo

func (*NullLit) Type

func (n *NullLit) Type() NodeType

type NumLit

type NumLit struct {
	// contains filtered or unexported fields
}

func (*NumLit) OuterParen

func (n *NumLit) OuterParen() span.Range

func (*NumLit) Range added in v0.0.10

func (n *NumLit) Range() span.Range

func (*NumLit) SetOuterParen

func (n *NumLit) SetOuterParen(rng span.Range)

func (*NumLit) Type

func (n *NumLit) Type() NodeType

type ObjLit

type ObjLit struct {
	// contains filtered or unexported fields
}

#[visitor(Props)]

func (*ObjLit) OuterParen

func (n *ObjLit) OuterParen() span.Range

func (*ObjLit) Props

func (n *ObjLit) Props() []Node

func (*ObjLit) Range added in v0.0.10

func (n *ObjLit) Range() span.Range

func (*ObjLit) SetOuterParen

func (n *ObjLit) SetOuterParen(rng span.Range)

func (*ObjLit) SetTypInfo

func (n *ObjLit) SetTypInfo(ti *TypInfo)

func (*ObjLit) TypInfo

func (n *ObjLit) TypInfo() *TypInfo

func (*ObjLit) Type

func (n *ObjLit) Type() NodeType

type ObjPat

type ObjPat struct {
	// contains filtered or unexported fields
}

#[visitor(Props)]

func (*ObjPat) OuterParen

func (n *ObjPat) OuterParen() span.Range

func (*ObjPat) Props

func (n *ObjPat) Props() []Node

func (*ObjPat) Range added in v0.0.10

func (n *ObjPat) Range() span.Range

func (*ObjPat) SetOuterParen

func (n *ObjPat) SetOuterParen(rng span.Range)

func (*ObjPat) SetTypInfo

func (n *ObjPat) SetTypInfo(ti *TypInfo)

func (*ObjPat) TypInfo

func (n *ObjPat) TypInfo() *TypInfo

func (*ObjPat) Type

func (n *ObjPat) Type() NodeType

type ParenExpr

type ParenExpr struct {
	// contains filtered or unexported fields
}

#[visitor(Expr)]

func (*ParenExpr) Expr

func (n *ParenExpr) Expr() Node

func (*ParenExpr) OuterParen

func (n *ParenExpr) OuterParen() span.Range

func (*ParenExpr) Range added in v0.0.10

func (n *ParenExpr) Range() span.Range

func (*ParenExpr) SetOuterParen

func (n *ParenExpr) SetOuterParen(rng span.Range)

func (*ParenExpr) Type

func (n *ParenExpr) Type() NodeType

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

parser is one-pass mode and returns the first error in which either syntax-error or semantic-error

it supports below syntaxes out-of-box by setting the `ParserOpts.Feature`:

- ecmascript up to 2020 - jsx - typescript

an AST couple with a Symtab will be constructed after the source is processed successfully

func NewParser

func NewParser(src *span.Source, opts *ParserOpts) *Parser

func (*Parser) Ast

func (p *Parser) Ast() Node

func (*Parser) Lexer

func (p *Parser) Lexer() *Lexer

func (*Parser) NodeText added in v0.0.10

func (p *Parser) NodeText(n Node) string

func (*Parser) PostCmts added in v0.0.10

func (p *Parser) PostCmts(stmt Node) []span.Range

func (*Parser) PrevCmts added in v0.0.10

func (p *Parser) PrevCmts(stmt Node) []span.Range

func (*Parser) Prog

func (p *Parser) Prog() (Node, error)

func (*Parser) RngText added in v0.0.10

func (p *Parser) RngText(rng span.Range) string

func (*Parser) Setup

func (p *Parser) Setup(src *span.Source, opts *ParserOpts)

func (*Parser) Source added in v0.0.10

func (p *Parser) Source() *span.Source

func (*Parser) Symtab

func (p *Parser) Symtab() *SymTab

func (*Parser) TokText added in v0.0.10

func (p *Parser) TokText(t *Token) string

type ParserError

type ParserError struct {
	// contains filtered or unexported fields
}

func (*ParserError) Error

func (e *ParserError) Error() string

func (*ParserError) MarshalJSON

func (e *ParserError) MarshalJSON() ([]byte, error)

type ParserOpts

type ParserOpts struct {
	Externals []string
	Version   ESVersion
	Feature   Feature
}

func NewParserOpts

func NewParserOpts() *ParserOpts

func (*ParserOpts) Clone

func (o *ParserOpts) Clone() *ParserOpts

func (*ParserOpts) MergeJson

func (o *ParserOpts) MergeJson(obj map[string]interface{})

type Prog

type Prog struct {
	// contains filtered or unexported fields
}

#[visitor(Body)]

func (*Prog) Body

func (n *Prog) Body() []Node

func (*Prog) Range added in v0.0.10

func (n *Prog) Range() span.Range

func (*Prog) Type

func (n *Prog) Type() NodeType

type Prop

type Prop struct {
	// contains filtered or unexported fields
}

#[visitor(Key,Val)]

func (*Prop) Computed

func (n *Prop) Computed() bool

func (*Prop) Key

func (n *Prop) Key() Node

func (*Prop) Kind

func (n *Prop) Kind() string

func (*Prop) Method

func (n *Prop) Method() bool

func (*Prop) PropKind

func (n *Prop) PropKind() PropKind

func (*Prop) Range added in v0.0.10

func (n *Prop) Range() span.Range

func (*Prop) Shorthand

func (n *Prop) Shorthand() bool

func (*Prop) Type

func (n *Prop) Type() NodeType

func (*Prop) Val

func (n *Prop) Val() Node

type PropKind

type PropKind uint8
const (
	PK_NONE PropKind = iota
	PK_INIT
	PK_GETTER
	PK_SETTER
	PK_CTOR
	PK_METHOD
)

func (PropKind) ToString

func (pk PropKind) ToString() string

type Ref

type Ref struct {
	Scope *Scope
	Id    *Ident
	Dec   Node
	Typ   RefDefType

	// points to the ref referenced by this one, eg:
	//
	// “`
	// A -> B // A points to B
	// “`
	//
	// `B` is the value of `Forward` of `A`
	Forward *Ref

	// ref with bind kind not none means it's a variable binding
	BindKind BindKind
}

func NewRef

func NewRef() *Ref

func (*Ref) RetainBy

func (r *Ref) RetainBy(ref *Ref)

type RefDefType

type RefDefType uint32
const (
	RDT_NONE RefDefType = 0
	RDT_FN   RefDefType = 1 << iota
	RDT_PVT_FIELD
	RDT_CLASS
	RDT_IMPORT
	RDT_ENUM
	RDT_CONST_ENUM
	RDT_ITF
	RDT_NS
	RDT_TYPE
)

func (RefDefType) IsPureTyp

func (t RefDefType) IsPureTyp() bool

func (RefDefType) IsPureVal

func (t RefDefType) IsPureVal() bool

func (RefDefType) IsTyp

func (t RefDefType) IsTyp() bool

func (RefDefType) IsVal

func (t RefDefType) IsVal() bool

func (RefDefType) Off

func (t RefDefType) Off(flag RefDefType) RefDefType

func (RefDefType) On

func (t RefDefType) On(flag RefDefType) RefDefType

type RegLit

type RegLit struct {
	// contains filtered or unexported fields
}

func (*RegLit) Flags

func (n *RegLit) Flags() string

func (*RegLit) OuterParen

func (n *RegLit) OuterParen() span.Range

func (*RegLit) Pattern

func (n *RegLit) Pattern() string

func (*RegLit) Range added in v0.0.10

func (n *RegLit) Range() span.Range

func (*RegLit) SetOuterParen

func (n *RegLit) SetOuterParen(rng span.Range)

func (*RegLit) SetTypInfo

func (n *RegLit) SetTypInfo(ti *TypInfo)

func (*RegLit) TypInfo

func (n *RegLit) TypInfo() *TypInfo

func (*RegLit) Type

func (n *RegLit) Type() NodeType

type RestPat

type RestPat struct {
	// contains filtered or unexported fields
}

#[visitor(Arg)]

func (*RestPat) Arg

func (n *RestPat) Arg() Node

func (*RestPat) Optional

func (n *RestPat) Optional() bool

func (*RestPat) OuterParen

func (n *RestPat) OuterParen() span.Range

func (*RestPat) Range added in v0.0.10

func (n *RestPat) Range() span.Range

func (*RestPat) SetOuterParen

func (n *RestPat) SetOuterParen(rng span.Range)

func (*RestPat) TypInfo

func (n *RestPat) TypInfo() *TypInfo

func (*RestPat) Type

func (n *RestPat) Type() NodeType

type RetStmt

type RetStmt struct {
	// contains filtered or unexported fields
}

#[visitor(Arg)]

func (*RetStmt) Arg

func (n *RetStmt) Arg() Node

func (*RetStmt) Range added in v0.0.10

func (n *RetStmt) Range() span.Range

func (*RetStmt) Type

func (n *RetStmt) Type() NodeType

type Scope

type Scope struct {
	// an auto-increment number which is generated according
	// the depth-first walk over the entire AST
	Id   int
	Kind ScopeKind

	// the Node which introduces this Scope, only usable after the scope is post-process since
	// the Node has not been resolved before the scope leave, eg. `p.fnDec“ can also return `ArrowFn`
	Node

	Up   *Scope
	Down []*Scope

	// labels can be redefined in their defined scope
	// so slice type used here
	Labels []Node

	// `IsBind` of the elems of the `scope.Refs` are all `true`,
	// `IsBind` of their children are `true` means `rebind`
	Refs map[string]*Ref

	// exports declared at this scope
	Exports []*ExportDec
	// contains filtered or unexported fields
}

func NewScope

func NewScope() *Scope

func (*Scope) AddKind

func (s *Scope) AddKind(kind ScopeKind) *Scope

func (*Scope) AddLocal

func (s *Scope) AddLocal(ref *Ref, name string, checkDup bool) bool

func (*Scope) BindingOf

func (s *Scope) BindingOf(name string) *Ref

func (*Scope) DelLocal

func (s *Scope) DelLocal(ref *Ref)

func (*Scope) EraseKind

func (s *Scope) EraseKind(kind ScopeKind) *Scope

func (*Scope) GetLabel

func (s *Scope) GetLabel(name string) Node

func (*Scope) HasLabel

func (s *Scope) HasLabel(name string) bool

func (*Scope) HasName

func (s *Scope) HasName(name string) bool

func (*Scope) IsKind

func (s *Scope) IsKind(kind ScopeKind) bool

func (*Scope) Local

func (s *Scope) Local(name string) *Ref

func (*Scope) OuterFn

func (s *Scope) OuterFn() *Scope

func (*Scope) OuterScope

func (s *Scope) OuterScope() *Scope

func (*Scope) UpperCls

func (s *Scope) UpperCls() *Scope

func (*Scope) UpperFn

func (s *Scope) UpperFn() *Scope

func (*Scope) UpperLoop

func (s *Scope) UpperLoop() *Scope

func (*Scope) UpperScope

func (s *Scope) UpperScope(kinds *[]ScopeKind) *Scope

type ScopeKind

type ScopeKind uint64
const (
	SPK_NONE        ScopeKind = 0
	SPK_LOOP_DIRECT ScopeKind = 1 << iota
	SPK_LOOP_INDIRECT
	SPK_SWITCH
	SPK_SWITCH_INDIRECT
	SPK_STRICT
	SPK_STRICT_DIR
	SPK_TRY
	SPK_TRY_INDIRECT
	SPK_CATCH
	SPK_BLOCK
	SPK_GLOBAL
	SPK_INTERIM
	SPK_FUNC
	SPK_FUNC_INDIRECT
	SPK_ARROW
	SPK_ASYNC
	SPK_GENERATOR
	SPK_PAREN
	SPK_CLASS
	SPK_CLASS_INDIRECT
	SPK_CLASS_EXTEND_SUPER
	SPK_CLASS_HAS_SUPER
	SPK_CTOR
	SPK_LEXICAL_DEC
	SPK_SHORTHAND_PROP
	SPK_METHOD
	SPK_NOT_IN
	SPK_PROP_NAME
	SPK_FORMAL_PARAMS
	SPK_ABSTRACT_CLASS
	SPK_TS_DECLARE
	SPK_TS_MODULE
	SPK_TS_MODULE_INDIRECT
	SPK_TS_INTERFACE
	SPK_TS_MAY_INTRINSIC
)

type SeqExpr

type SeqExpr struct {
	// contains filtered or unexported fields
}

#[visitor(Elems)]

func (*SeqExpr) Elems

func (n *SeqExpr) Elems() []Node

func (*SeqExpr) OuterParen

func (n *SeqExpr) OuterParen() span.Range

func (*SeqExpr) Range added in v0.0.10

func (n *SeqExpr) Range() span.Range

func (*SeqExpr) SetOuterParen

func (n *SeqExpr) SetOuterParen(rng span.Range)

func (*SeqExpr) Type

func (n *SeqExpr) Type() NodeType

type Spread

type Spread struct {
	// contains filtered or unexported fields
}

#[visitor(Arg)]

func (*Spread) Arg

func (n *Spread) Arg() Node

func (*Spread) OuterParen

func (n *Spread) OuterParen() span.Range

func (*Spread) Range added in v0.0.10

func (n *Spread) Range() span.Range

func (*Spread) SetOuterParen

func (n *Spread) SetOuterParen(rng span.Range)

func (*Spread) SetTypInfo

func (n *Spread) SetTypInfo(ti *TypInfo)

func (*Spread) TypInfo

func (n *Spread) TypInfo() *TypInfo

func (*Spread) Type

func (n *Spread) Type() NodeType

type StaticBlock

type StaticBlock struct {
	// contains filtered or unexported fields
}

#[visitor(Body)]

func (*StaticBlock) Body

func (n *StaticBlock) Body() []Node

func (*StaticBlock) Range added in v0.0.10

func (n *StaticBlock) Range() span.Range

func (*StaticBlock) SetTypInfo

func (n *StaticBlock) SetTypInfo(ti *TypInfo)

func (*StaticBlock) TypInfo

func (n *StaticBlock) TypInfo() *TypInfo

func (*StaticBlock) Type

func (n *StaticBlock) Type() NodeType

type StrLit

type StrLit struct {
	// contains filtered or unexported fields
}

func (*StrLit) OuterParen

func (n *StrLit) OuterParen() span.Range

func (*StrLit) Range added in v0.0.10

func (n *StrLit) Range() span.Range

func (*StrLit) SetOuterParen

func (n *StrLit) SetOuterParen(rng span.Range)

func (*StrLit) SetTypInfo

func (n *StrLit) SetTypInfo(ti *TypInfo)

func (*StrLit) TypInfo

func (n *StrLit) TypInfo() *TypInfo

func (*StrLit) Type

func (n *StrLit) Type() NodeType

func (*StrLit) Val added in v0.0.10

func (n *StrLit) Val() string

type Super

type Super struct {
	// contains filtered or unexported fields
}

func (*Super) OuterParen

func (n *Super) OuterParen() span.Range

func (*Super) Range added in v0.0.10

func (n *Super) Range() span.Range

func (*Super) SetOuterParen

func (n *Super) SetOuterParen(rng span.Range)

func (*Super) SetTypInfo

func (n *Super) SetTypInfo(ti *TypInfo)

func (*Super) TypInfo

func (n *Super) TypInfo() *TypInfo

func (*Super) Type

func (n *Super) Type() NodeType

type SwitchCase

type SwitchCase struct {
	// contains filtered or unexported fields
}

#[visitor(Test,Cons)]

func (*SwitchCase) Cons

func (n *SwitchCase) Cons() []Node

func (*SwitchCase) Range added in v0.0.10

func (n *SwitchCase) Range() span.Range

func (*SwitchCase) Test

func (n *SwitchCase) Test() Node

func (*SwitchCase) Type

func (n *SwitchCase) Type() NodeType

type SwitchStmt

type SwitchStmt struct {
	// contains filtered or unexported fields
}

#[visitor(PUSH_SCOPE,Test,Cases)]

func (*SwitchStmt) Cases

func (n *SwitchStmt) Cases() []Node

func (*SwitchStmt) Range added in v0.0.10

func (n *SwitchStmt) Range() span.Range

func (*SwitchStmt) Test

func (n *SwitchStmt) Test() Node

func (*SwitchStmt) Type

func (n *SwitchStmt) Type() NodeType

type SymTab

type SymTab struct {
	Externals []string
	Scopes    map[int]*Scope
	Root      *Scope
	Cur       *Scope
	// contains filtered or unexported fields
}

func NewSymTab

func NewSymTab(externals []string) *SymTab

func (*SymTab) EnterScope

func (s *SymTab) EnterScope(fn bool, arrow bool, settled bool) *Scope

`settled` to increase the scope id, otherwise the new entered scope will be treated as a temporary one

func (*SymTab) HasExternal

func (s *SymTab) HasExternal(name string) bool

func (*SymTab) LeaveScope

func (s *SymTab) LeaveScope() *Scope

type ThisExpr

type ThisExpr struct {
	// contains filtered or unexported fields
}

func (*ThisExpr) OuterParen

func (n *ThisExpr) OuterParen() span.Range

func (*ThisExpr) Range added in v0.0.10

func (n *ThisExpr) Range() span.Range

func (*ThisExpr) SetOuterParen

func (n *ThisExpr) SetOuterParen(rng span.Range)

func (*ThisExpr) SetTypInfo

func (n *ThisExpr) SetTypInfo(ti *TypInfo)

func (*ThisExpr) TypInfo

func (n *ThisExpr) TypInfo() *TypInfo

func (*ThisExpr) Type

func (n *ThisExpr) Type() NodeType

type ThrowStmt

type ThrowStmt struct {
	// contains filtered or unexported fields
}

#[visitor(Arg)]

func (*ThrowStmt) Arg

func (n *ThrowStmt) Arg() Node

func (*ThrowStmt) Range added in v0.0.10

func (n *ThrowStmt) Range() span.Range

func (*ThrowStmt) Target

func (n *ThrowStmt) Target() Node

func (*ThrowStmt) Type

func (n *ThrowStmt) Type() NodeType

type TokExtIdent

type TokExtIdent struct {
	ContainsEscape bool
}

type TokExtRegexp

type TokExtRegexp struct {
	// contains filtered or unexported fields
}

type TokExtStr

type TokExtStr struct {
	Open                 rune
	LegacyOctalEscapeSeq bool
}

type TokExtTplSpan

type TokExtTplSpan struct {
	Plain bool

	// from ES2018 and later the tagged template can contain
	// illegal escape sequence, here records loc of the illegal
	// sequence to report lexer error under ES2018
	// see more details about that from: ES2018 revision of illegal escape sequences
	// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
	IllegalEscape *IllegalEscapeInfo
	// contains filtered or unexported fields
}

type Token

type Token struct {
	// contains filtered or unexported fields
}

func (*Token) CanBePropKey

func (t *Token) CanBePropKey() (bool, bool)

func (*Token) ContainsEscape

func (t *Token) ContainsEscape() bool

func (*Token) ErrMsg

func (t *Token) ErrMsg() string

func (*Token) HasLegacyOctalEscapeSeq

func (t *Token) HasLegacyOctalEscapeSeq() bool

func (*Token) IsBin

func (t *Token) IsBin(notIn bool, ts bool) TokenValue

func (*Token) IsCtxKw

func (t *Token) IsCtxKw() bool

func (*Token) IsKw

func (t *Token) IsKw() bool

func (*Token) IsLegal

func (t *Token) IsLegal() bool

func (*Token) IsLit

func (t *Token) IsLit(in bool) bool

func (*Token) IsPlainTpl

func (t *Token) IsPlainTpl() bool

func (*Token) IsUnary

func (t *Token) IsUnary() bool

func (*Token) Kind

func (t *Token) Kind() *TokenKind

func (*Token) Len

func (t *Token) Len() uint32

func (*Token) Val

func (t *Token) Val() TokenValue

type TokenKind

type TokenKind struct {
	Value      TokenValue
	Name       string
	Pcd        int
	RightAssoc bool

	// reference [acorn](https://github.com/acornjs/acorn/blob/master/acorn/src/tokentype.js)
	// `beforeExpr` is attached to each token to indicate that the slashes after those
	// tokens would be the beginning of regexps if the value of `beforeExpr` are `true`, works at
	// tokenizing phase
	BeforeExpr bool

	// `StartExpr` is attached to each token to indicate the token itself is the beginning of an expr,
	// it's used when parsing the argument of `yield`
	StartExpr bool
}

type TokenValue

type TokenValue int
const (
	T_ILLEGAL TokenValue = iota
	T_EOF
	T_COMMENT

	// literals
	T_NULL
	T_TRUE
	T_FALSE
	T_NUM
	T_STRING

	T_TPL_HEAD
	T_TPL_SPAN
	T_TPL_TAIL

	T_NAME
	T_NAME_PVT

	// keywords
	// https://tc39.es/ecma262/multipage/ecmascript-language-lexical-grammar.html#prod-ReservedWord
	T_KEYWORD_BEGIN
	T_BREAK
	T_CASE
	T_CATCH
	T_CLASS
	T_CONTINUE
	T_DEBUGGER
	T_DEFAULT
	T_DO
	T_ELSE
	T_ENUM
	T_EXPORT
	T_EXTENDS
	T_FINALLY
	T_FOR
	T_FUNC
	T_IF
	T_IMPORT
	T_NEW
	T_RETURN
	T_SUPER
	T_SWITCH
	T_THIS
	T_THROW
	T_TRY
	T_VAR
	T_WHILE
	T_WITH
	T_KEYWORD_END

	// contextual keywords
	T_CTX_KEYWORD_BEGIN
	// token treated as keyword in strict mode
	T_CTX_KEYWORD_STRICT_BEGIN
	T_LET
	T_CONST
	T_STATIC
	T_IMPLEMENTS
	T_INTERFACE
	T_PACKAGE
	T_PRIVATE
	T_PROTECTED
	T_PUBLIC
	T_YIELD
	T_CTX_KEYWORD_STRICT_END
	T_AS
	T_ASYNC
	T_AWAIT
	T_FROM
	T_GET
	T_META
	T_OF
	T_SET
	T_TARGET
	T_CTX_KEYWORD_END

	T_REGEXP
	T_BACK_QUOTE
	T_BRACE_L
	T_BRACE_R
	T_PAREN_L
	T_PAREN_R
	T_BRACKET_L
	T_BRACKET_R
	T_DOT
	T_DOT_TRI
	T_SEMI
	T_COMMA
	T_HOOK
	T_COLON
	T_INC
	T_DEC
	T_OPT_CHAIN
	T_ARROW

	T_BIN_OP_BEGIN
	T_NULLISH

	// relational
	T_LT
	T_GT
	T_LTE
	T_GTE

	// equality
	T_EQ
	T_NE
	T_EQ_S
	T_NE_S

	// bitwise
	T_LSH
	T_RSH
	T_RSH_U
	T_BIT_OR
	T_BIT_XOR
	T_BIT_AND

	T_OR
	T_AND

	T_INSTANCE_OF
	T_IN

	T_ADD
	T_SUB
	T_MUL
	T_DIV
	T_MOD
	T_POW
	T_BIN_OP_END

	// unary
	T_UNARY_OP_BEGIN
	T_TYPE_OF
	T_VOID
	T_DELETE
	T_NOT
	T_BIT_NOT
	T_UNARY_OP_END

	// assignment
	T_ASSIGN_BEGIN
	T_ASSIGN
	T_ASSIGN_ADD
	T_ASSIGN_SUB
	T_ASSIGN_NULLISH
	T_ASSIGN_OR
	T_ASSIGN_AND
	T_ASSIGN_BIT_OR
	T_ASSIGN_BIT_XOR
	T_ASSIGN_BIT_AND
	T_ASSIGN_BIT_LSH
	T_ASSIGN_BIT_RSH
	T_ASSIGN_BIT_RSH_U
	T_ASSIGN_MUL
	T_ASSIGN_DIV
	T_ASSIGN_MOD
	T_ASSIGN_POW
	T_ASSIGN_END

	T_JSX_TXT
	T_HYPHEN

	T_TS_AS
	T_TS_NO_NULL
	T_AT

	T_TOKEN_DEF_END
)

type TokensBuf

type TokensBuf struct {
	// contains filtered or unexported fields
}

type TplExpr

type TplExpr struct {
	// contains filtered or unexported fields
}

there is no information kept to describe the program order of the quasis and expressions according to below link descries how the quasis and expression are being walk over: https://opensource.apple.com/source/WebInspectorUI/WebInspectorUI-7602.2.14.0.5/UserInterface/Workers/Formatter/ESTreeWalker.js.auto.html some meaningless output should be taken into its estree result, such as put first quasis as a empty string if the first element in `elems` is a expression

#[visitor(Tag,Elems)]

func (*TplExpr) Elems

func (n *TplExpr) Elems() []Node

func (*TplExpr) OuterParen

func (n *TplExpr) OuterParen() span.Range

func (*TplExpr) Range added in v0.0.10

func (n *TplExpr) Range() span.Range

func (*TplExpr) SetOuterParen

func (n *TplExpr) SetOuterParen(rng span.Range)

func (*TplExpr) Tag

func (n *TplExpr) Tag() Node

func (*TplExpr) Type

func (n *TplExpr) Type() NodeType

type TryStmt

type TryStmt struct {
	// contains filtered or unexported fields
}

#[visitor(Try,Catch,Fin)]

func (*TryStmt) Catch

func (n *TryStmt) Catch() Node

func (*TryStmt) Fin

func (n *TryStmt) Fin() Node

func (*TryStmt) Range added in v0.0.10

func (n *TryStmt) Range() span.Range

func (*TryStmt) Try

func (n *TryStmt) Try() Node

func (*TryStmt) Type

func (n *TryStmt) Type() NodeType

type TsArr

type TsArr struct {
	// contains filtered or unexported fields
}

#[visitor(Arg)]

func (*TsArr) Arg

func (n *TsArr) Arg() Node

func (*TsArr) OuterParen

func (n *TsArr) OuterParen() span.Range

func (*TsArr) Range added in v0.0.10

func (n *TsArr) Range() span.Range

func (*TsArr) SetOuterParen

func (n *TsArr) SetOuterParen(rng span.Range)

func (*TsArr) Type

func (n *TsArr) Type() NodeType

type TsCallSig

type TsCallSig struct {
	// contains filtered or unexported fields
}

#[visitor(TypParams,Params,RetTyp)]

func (*TsCallSig) Params

func (n *TsCallSig) Params() []Node

func (*TsCallSig) Range added in v0.0.10

func (n *TsCallSig) Range() span.Range

func (*TsCallSig) RetTyp

func (n *TsCallSig) RetTyp() Node

func (*TsCallSig) TypParams

func (n *TsCallSig) TypParams() Node

func (*TsCallSig) Type

func (n *TsCallSig) Type() NodeType

type TsCheckParamOpts

type TsCheckParamOpts struct {
	// contains filtered or unexported fields
}

func NewTsCheckParamOpts

func NewTsCheckParamOpts() *TsCheckParamOpts

type TsCondType

type TsCondType struct {
	// contains filtered or unexported fields
}

#[visitor(CheckTyp,ExtTyp,TrueTyp,FalseTyp)]

func (*TsCondType) CheckTyp

func (n *TsCondType) CheckTyp() Node

func (*TsCondType) ExtTyp

func (n *TsCondType) ExtTyp() Node

func (*TsCondType) FalseTyp

func (n *TsCondType) FalseTyp() Node

func (*TsCondType) OuterParen

func (n *TsCondType) OuterParen() span.Range

func (*TsCondType) Range added in v0.0.10

func (n *TsCondType) Range() span.Range

func (*TsCondType) SetOuterParen

func (n *TsCondType) SetOuterParen(rng span.Range)

func (*TsCondType) TrueTyp

func (n *TsCondType) TrueTyp() Node

func (*TsCondType) Type

func (n *TsCondType) Type() NodeType

type TsDec

type TsDec struct {
	// contains filtered or unexported fields
}

#[visitor(Name,Inner)]

func (*TsDec) Inner

func (n *TsDec) Inner() Node

func (*TsDec) Name

func (n *TsDec) Name() Node

func (*TsDec) Range added in v0.0.10

func (n *TsDec) Range() span.Range

func (*TsDec) Type

func (n *TsDec) Type() NodeType

type TsEnum

type TsEnum struct {
	// contains filtered or unexported fields
}

#[visitor(Id,Members)]

func (*TsEnum) Const

func (n *TsEnum) Const() bool

func (*TsEnum) Id

func (n *TsEnum) Id() Node

func (*TsEnum) Members

func (n *TsEnum) Members() []Node

func (*TsEnum) Range added in v0.0.10

func (n *TsEnum) Range() span.Range

func (*TsEnum) Type

func (n *TsEnum) Type() NodeType

type TsEnumMember

type TsEnumMember struct {
	// contains filtered or unexported fields
}

#[visitor(Key,Val)]

func (*TsEnumMember) Key

func (n *TsEnumMember) Key() Node

func (*TsEnumMember) Range added in v0.0.10

func (n *TsEnumMember) Range() span.Range

func (*TsEnumMember) Type

func (n *TsEnumMember) Type() NodeType

func (*TsEnumMember) Val

func (n *TsEnumMember) Val() Node

type TsExportAssign

type TsExportAssign struct {
	// contains filtered or unexported fields
}

#[visitor(Expr)]

func (*TsExportAssign) Expr

func (n *TsExportAssign) Expr() Node

func (*TsExportAssign) Range added in v0.0.10

func (n *TsExportAssign) Range() span.Range

func (*TsExportAssign) Type

func (n *TsExportAssign) Type() NodeType

type TsFnTyp

type TsFnTyp struct {
	// contains filtered or unexported fields
}

#[visitor(TypParams,Params,RetTyp)]

func (*TsFnTyp) OuterParen

func (n *TsFnTyp) OuterParen() span.Range

func (*TsFnTyp) Params

func (n *TsFnTyp) Params() []Node

func (*TsFnTyp) Range added in v0.0.10

func (n *TsFnTyp) Range() span.Range

func (*TsFnTyp) RetTyp

func (n *TsFnTyp) RetTyp() Node

func (*TsFnTyp) SetOuterParen

func (n *TsFnTyp) SetOuterParen(rng span.Range)

func (*TsFnTyp) TypParams

func (n *TsFnTyp) TypParams() Node

func (*TsFnTyp) Type

func (n *TsFnTyp) Type() NodeType

type TsIdxAccess

type TsIdxAccess struct {
	// contains filtered or unexported fields
}

#[visitor(Obj,Idx)]

func (*TsIdxAccess) Idx

func (n *TsIdxAccess) Idx() Node

func (*TsIdxAccess) Obj

func (n *TsIdxAccess) Obj() Node

func (*TsIdxAccess) OuterParen

func (n *TsIdxAccess) OuterParen() span.Range

func (*TsIdxAccess) Range added in v0.0.10

func (n *TsIdxAccess) Range() span.Range

func (*TsIdxAccess) SetOuterParen

func (n *TsIdxAccess) SetOuterParen(rng span.Range)

func (*TsIdxAccess) Type

func (n *TsIdxAccess) Type() NodeType

type TsIdxSig

type TsIdxSig struct {
	// contains filtered or unexported fields
}

#[visitor(Key,KeyType,Val)]

func (*TsIdxSig) Key

func (n *TsIdxSig) Key() Node

func (*TsIdxSig) KeyType

func (n *TsIdxSig) KeyType() Node

func (*TsIdxSig) Optional

func (n *TsIdxSig) Optional() bool

func (*TsIdxSig) Range added in v0.0.10

func (n *TsIdxSig) Range() span.Range

func (*TsIdxSig) Type

func (n *TsIdxSig) Type() NodeType

func (*TsIdxSig) Val

func (n *TsIdxSig) Val() Node

type TsImportAlias

type TsImportAlias struct {
	// contains filtered or unexported fields
}

#[visitor(Name,Val)]

func (*TsImportAlias) Export

func (n *TsImportAlias) Export() bool

func (*TsImportAlias) Name

func (n *TsImportAlias) Name() Node

func (*TsImportAlias) Range added in v0.0.10

func (n *TsImportAlias) Range() span.Range

func (*TsImportAlias) Type

func (n *TsImportAlias) Type() NodeType

func (*TsImportAlias) Val

func (n *TsImportAlias) Val() Node

type TsImportRequire

type TsImportRequire struct {
	// contains filtered or unexported fields
}

#[visitor(Name,Expr)]

func (*TsImportRequire) Expr

func (n *TsImportRequire) Expr() Node

func (*TsImportRequire) Name

func (n *TsImportRequire) Name() Node

func (*TsImportRequire) OuterParen

func (n *TsImportRequire) OuterParen() span.Range

func (*TsImportRequire) Range added in v0.0.10

func (n *TsImportRequire) Range() span.Range

func (*TsImportRequire) SetOuterParen

func (n *TsImportRequire) SetOuterParen(rng span.Range)

func (*TsImportRequire) Type

func (n *TsImportRequire) Type() NodeType

type TsImportType

type TsImportType struct {
	// contains filtered or unexported fields
}

#[visitor(Arg,Qualifier,TypArg)]

func (*TsImportType) Arg

func (n *TsImportType) Arg() Node

func (*TsImportType) OuterParen

func (n *TsImportType) OuterParen() span.Range

func (*TsImportType) Qualifier

func (n *TsImportType) Qualifier() Node

func (*TsImportType) Range added in v0.0.10

func (n *TsImportType) Range() span.Range

func (*TsImportType) SetOuterParen

func (n *TsImportType) SetOuterParen(rng span.Range)

func (*TsImportType) TypArg

func (n *TsImportType) TypArg() Node

func (*TsImportType) Type

func (n *TsImportType) Type() NodeType

type TsInterface

type TsInterface struct {
	// contains filtered or unexported fields
}

#[visitor(Id,TypParams,Supers,Body)]

func (*TsInterface) Body

func (n *TsInterface) Body() Node

func (*TsInterface) Id

func (n *TsInterface) Id() Node

func (*TsInterface) Range added in v0.0.10

func (n *TsInterface) Range() span.Range

func (*TsInterface) Supers

func (n *TsInterface) Supers() []Node

func (*TsInterface) TypParams

func (n *TsInterface) TypParams() Node

func (*TsInterface) Type

func (n *TsInterface) Type() NodeType

type TsInterfaceBody

type TsInterfaceBody struct {
	// contains filtered or unexported fields
}

#[visitor(Body)]

func (*TsInterfaceBody) Body

func (n *TsInterfaceBody) Body() []Node

func (*TsInterfaceBody) Range added in v0.0.10

func (n *TsInterfaceBody) Range() span.Range

func (*TsInterfaceBody) Type

func (n *TsInterfaceBody) Type() NodeType

type TsIntersectTyp

type TsIntersectTyp struct {
	// contains filtered or unexported fields
}

#[visitor(Elems)]

func (*TsIntersectTyp) Elems

func (n *TsIntersectTyp) Elems() []Node

func (*TsIntersectTyp) OuterParen

func (n *TsIntersectTyp) OuterParen() span.Range

func (*TsIntersectTyp) Range added in v0.0.10

func (n *TsIntersectTyp) Range() span.Range

func (*TsIntersectTyp) SetOuterParen

func (n *TsIntersectTyp) SetOuterParen(rng span.Range)

func (*TsIntersectTyp) Type

func (n *TsIntersectTyp) Type() NodeType

type TsLit

type TsLit struct {
	// contains filtered or unexported fields
}

#[visitor(Lit)]

func (*TsLit) Lit

func (n *TsLit) Lit() Node

func (*TsLit) OuterParen

func (n *TsLit) OuterParen() span.Range

func (*TsLit) Range added in v0.0.10

func (n *TsLit) Range() span.Range

func (*TsLit) SetOuterParen

func (n *TsLit) SetOuterParen(rng span.Range)

func (*TsLit) Type

func (n *TsLit) Type() NodeType

type TsMapped

type TsMapped struct {
	// contains filtered or unexported fields
}

#[visitor(Name,Key,Val)]

func (*TsMapped) Key

func (n *TsMapped) Key() Node

func (*TsMapped) Name

func (n *TsMapped) Name() Node

func (*TsMapped) Optional

func (n *TsMapped) Optional() int

func (*TsMapped) OptionalFmt

func (n *TsMapped) OptionalFmt() interface{}

func (*TsMapped) OuterParen

func (n *TsMapped) OuterParen() span.Range

func (*TsMapped) Range added in v0.0.10

func (n *TsMapped) Range() span.Range

func (*TsMapped) Readonly

func (n *TsMapped) Readonly() int

func (*TsMapped) ReadonlyFmt

func (n *TsMapped) ReadonlyFmt() interface{}

func (*TsMapped) SetOuterParen

func (n *TsMapped) SetOuterParen(rng span.Range)

func (*TsMapped) Type

func (n *TsMapped) Type() NodeType

func (*TsMapped) Val

func (n *TsMapped) Val() Node

type TsNS

type TsNS struct {
	// contains filtered or unexported fields
}

#[visitor(Id,Body)]

func (*TsNS) Alias

func (n *TsNS) Alias() bool

func (*TsNS) Body

func (n *TsNS) Body() Node

func (*TsNS) Id

func (n *TsNS) Id() Node

func (*TsNS) Range added in v0.0.10

func (n *TsNS) Range() span.Range

func (*TsNS) Type

func (n *TsNS) Type() NodeType

type TsNewSig

type TsNewSig struct {
	// contains filtered or unexported fields
}

#[visitor(TypParams,Params,RetTyp)]

func (*TsNewSig) Abstract

func (n *TsNewSig) Abstract() bool

func (*TsNewSig) Params

func (n *TsNewSig) Params() []Node

func (*TsNewSig) Range added in v0.0.10

func (n *TsNewSig) Range() span.Range

func (*TsNewSig) RetTyp

func (n *TsNewSig) RetTyp() Node

func (*TsNewSig) TypParams

func (n *TsNewSig) TypParams() Node

func (*TsNewSig) Type

func (n *TsNewSig) Type() NodeType

type TsNoNull

type TsNoNull struct {
	// contains filtered or unexported fields
}

#[visitor(Arg)]

func (*TsNoNull) Arg

func (n *TsNoNull) Arg() Node

func (*TsNoNull) OuterParen

func (n *TsNoNull) OuterParen() span.Range

func (*TsNoNull) Range added in v0.0.10

func (n *TsNoNull) Range() span.Range

func (*TsNoNull) SetOuterParen

func (n *TsNoNull) SetOuterParen(rng span.Range)

func (*TsNoNull) Type

func (n *TsNoNull) Type() NodeType

type TsNsName

type TsNsName struct {
	// contains filtered or unexported fields
}

#[visitor(Lhs,Rhs)]

func (*TsNsName) Lhs

func (n *TsNsName) Lhs() Node

func (*TsNsName) OuterParen

func (n *TsNsName) OuterParen() span.Range

func (*TsNsName) Range added in v0.0.10

func (n *TsNsName) Range() span.Range

func (*TsNsName) Rhs

func (n *TsNsName) Rhs() Node

func (*TsNsName) SetOuterParen

func (n *TsNsName) SetOuterParen(rng span.Range)

func (*TsNsName) Type

func (n *TsNsName) Type() NodeType

type TsObj

type TsObj struct {
	// contains filtered or unexported fields
}

#[visitor(Props)]

func (*TsObj) OuterParen

func (n *TsObj) OuterParen() span.Range

func (*TsObj) Props

func (n *TsObj) Props() []Node

func (*TsObj) Range added in v0.0.10

func (n *TsObj) Range() span.Range

func (*TsObj) SetOuterParen

func (n *TsObj) SetOuterParen(rng span.Range)

func (*TsObj) Type

func (n *TsObj) Type() NodeType

type TsOpt

type TsOpt struct {
	// contains filtered or unexported fields
}

#[visitor(Arg)]

func (*TsOpt) Arg

func (n *TsOpt) Arg() Node

func (*TsOpt) Range added in v0.0.10

func (n *TsOpt) Range() span.Range

func (*TsOpt) Type

func (n *TsOpt) Type() NodeType

type TsParam

type TsParam struct {
	// contains filtered or unexported fields
}

#[visitor(Name,Cons,Default)]

func (*TsParam) Cons

func (n *TsParam) Cons() Node

func (*TsParam) Default

func (n *TsParam) Default() Node

func (*TsParam) Name

func (n *TsParam) Name() Node

func (*TsParam) Range added in v0.0.10

func (n *TsParam) Range() span.Range

func (*TsParam) Type

func (n *TsParam) Type() NodeType

type TsParamsDec

type TsParamsDec struct {
	// contains filtered or unexported fields
}

#[visitor(Params)]

func (*TsParamsDec) Params

func (n *TsParamsDec) Params() []Node

func (*TsParamsDec) Range added in v0.0.10

func (n *TsParamsDec) Range() span.Range

func (*TsParamsDec) Type

func (n *TsParamsDec) Type() NodeType

type TsParamsInst

type TsParamsInst struct {
	// contains filtered or unexported fields
}

#[visitor(Params)]

func (*TsParamsInst) Params

func (n *TsParamsInst) Params() []Node

func (*TsParamsInst) Range added in v0.0.10

func (n *TsParamsInst) Range() span.Range

func (*TsParamsInst) Type

func (n *TsParamsInst) Type() NodeType

type TsParen

type TsParen struct {
	// contains filtered or unexported fields
}

#[visitor(Arg)]

func (*TsParen) Arg

func (n *TsParen) Arg() Node

func (*TsParen) OuterParen

func (n *TsParen) OuterParen() span.Range

func (*TsParen) Range added in v0.0.10

func (n *TsParen) Range() span.Range

func (*TsParen) SetOuterParen

func (n *TsParen) SetOuterParen(rng span.Range)

func (*TsParen) Type

func (n *TsParen) Type() NodeType

type TsPredef

type TsPredef struct {
	// contains filtered or unexported fields
}

func (*TsPredef) OuterParen

func (n *TsPredef) OuterParen() span.Range

func (*TsPredef) Range added in v0.0.10

func (n *TsPredef) Range() span.Range

func (*TsPredef) SetOuterParen

func (n *TsPredef) SetOuterParen(rng span.Range)

func (*TsPredef) Type

func (n *TsPredef) Type() NodeType

type TsProp

type TsProp struct {
	// contains filtered or unexported fields
}

#[visitor(Key,Val)]

func (*TsProp) Computed

func (n *TsProp) Computed() bool

func (*TsProp) IsMethod

func (n *TsProp) IsMethod() bool

func (*TsProp) Key

func (n *TsProp) Key() Node

func (*TsProp) Kind

func (n *TsProp) Kind() PropKind

func (*TsProp) Method

func (n *TsProp) Method() *TsCallSig

func (*TsProp) Optional

func (n *TsProp) Optional() bool

func (*TsProp) Range added in v0.0.10

func (n *TsProp) Range() span.Range

func (*TsProp) Readonly

func (n *TsProp) Readonly() bool

func (*TsProp) Type

func (n *TsProp) Type() NodeType

func (*TsProp) Val

func (n *TsProp) Val() Node

type TsRef

type TsRef struct {
	// contains filtered or unexported fields
}

#[visitor(Name,Args)]

func (*TsRef) Args

func (n *TsRef) Args() []Node

func (*TsRef) HasArgs

func (n *TsRef) HasArgs() bool

func (*TsRef) Name

func (n *TsRef) Name() Node

func (*TsRef) OuterParen

func (n *TsRef) OuterParen() span.Range

func (*TsRef) ParamsInst

func (n *TsRef) ParamsInst() Node

func (*TsRef) Range added in v0.0.10

func (n *TsRef) Range() span.Range

func (*TsRef) SetOuterParen

func (n *TsRef) SetOuterParen(rng span.Range)

func (*TsRef) Type

func (n *TsRef) Type() NodeType

type TsRest

type TsRest struct {
	// contains filtered or unexported fields
}

#[visitor(Arg)]

func (*TsRest) Arg

func (n *TsRest) Arg() Node

func (*TsRest) Range added in v0.0.10

func (n *TsRest) Range() span.Range

func (*TsRest) Type

func (n *TsRest) Type() NodeType

type TsRoughParam

type TsRoughParam struct {
	// contains filtered or unexported fields
}

func (*TsRoughParam) Range added in v0.0.10

func (n *TsRoughParam) Range() span.Range

func (*TsRoughParam) Type

func (n *TsRoughParam) Type() NodeType

type TsThis

type TsThis struct {
	// contains filtered or unexported fields
}

func (*TsThis) OuterParen

func (n *TsThis) OuterParen() span.Range

func (*TsThis) Range added in v0.0.10

func (n *TsThis) Range() span.Range

func (*TsThis) SetOuterParen

func (n *TsThis) SetOuterParen(rng span.Range)

func (*TsThis) Type

func (n *TsThis) Type() NodeType

type TsTuple

type TsTuple struct {
	// contains filtered or unexported fields
}

#[visitor(Args)]

func (*TsTuple) Args

func (n *TsTuple) Args() []Node

func (*TsTuple) OuterParen

func (n *TsTuple) OuterParen() span.Range

func (*TsTuple) Range added in v0.0.10

func (n *TsTuple) Range() span.Range

func (*TsTuple) SetOuterParen

func (n *TsTuple) SetOuterParen(rng span.Range)

func (*TsTuple) Type

func (n *TsTuple) Type() NodeType

type TsTupleNamedMember

type TsTupleNamedMember struct {
	// contains filtered or unexported fields
}

#[visitor(Label,Val)]

func (*TsTupleNamedMember) Label

func (n *TsTupleNamedMember) Label() Node

func (*TsTupleNamedMember) Opt

func (n *TsTupleNamedMember) Opt() bool

func (*TsTupleNamedMember) Range added in v0.0.10

func (n *TsTupleNamedMember) Range() span.Range

func (*TsTupleNamedMember) Type

func (n *TsTupleNamedMember) Type() NodeType

func (*TsTupleNamedMember) Val

func (n *TsTupleNamedMember) Val() Node

type TsTypAnnot

type TsTypAnnot struct {
	// contains filtered or unexported fields
}

#[visitor(TsTyp)]

func NewTsTypAnnot

func NewTsTypAnnot(typ Node) *TsTypAnnot

func (*TsTypAnnot) Range added in v0.0.10

func (n *TsTypAnnot) Range() span.Range

func (*TsTypAnnot) TsTyp

func (n *TsTypAnnot) TsTyp() Node

func (*TsTypAnnot) Type

func (n *TsTypAnnot) Type() NodeType

type TsTypAssert

type TsTypAssert struct {
	// contains filtered or unexported fields
}

#[visitor(Typ,Expr)]

func (*TsTypAssert) Expr

func (n *TsTypAssert) Expr() Node

func (*TsTypAssert) OuterParen

func (n *TsTypAssert) OuterParen() span.Range

func (*TsTypAssert) Range added in v0.0.10

func (n *TsTypAssert) Range() span.Range

func (*TsTypAssert) SetOuterParen

func (n *TsTypAssert) SetOuterParen(rng span.Range)

func (*TsTypAssert) Typ

func (n *TsTypAssert) Typ() Node

func (*TsTypAssert) Type

func (n *TsTypAssert) Type() NodeType

type TsTypDec

type TsTypDec struct {
	// contains filtered or unexported fields
}

#[visitor(Id,TypParams)]

func (*TsTypDec) Id

func (n *TsTypDec) Id() Node

func (*TsTypDec) Range added in v0.0.10

func (n *TsTypDec) Range() span.Range

func (*TsTypDec) TypInfo

func (n *TsTypDec) TypInfo() *TypInfo

func (*TsTypDec) TypParams

func (n *TsTypDec) TypParams() Node

func (*TsTypDec) Type

func (n *TsTypDec) Type() NodeType

type TsTypInfer

type TsTypInfer struct {
	// contains filtered or unexported fields
}

#[visitor(Arg)]

func (*TsTypInfer) Arg

func (n *TsTypInfer) Arg() Node

func (*TsTypInfer) OuterParen

func (n *TsTypInfer) OuterParen() span.Range

func (*TsTypInfer) Range added in v0.0.10

func (n *TsTypInfer) Range() span.Range

func (*TsTypInfer) SetOuterParen

func (n *TsTypInfer) SetOuterParen(rng span.Range)

func (*TsTypInfer) Type

func (n *TsTypInfer) Type() NodeType

type TsTypOp

type TsTypOp struct {
	// contains filtered or unexported fields
}

#[visitor(Arg)]

func (*TsTypOp) Arg

func (n *TsTypOp) Arg() Node

func (*TsTypOp) Op

func (n *TsTypOp) Op() string

func (*TsTypOp) OuterParen

func (n *TsTypOp) OuterParen() span.Range

func (*TsTypOp) Range added in v0.0.10

func (n *TsTypOp) Range() span.Range

func (*TsTypOp) SetOuterParen

func (n *TsTypOp) SetOuterParen(rng span.Range)

func (*TsTypOp) Type

func (n *TsTypOp) Type() NodeType

type TsTypPredicate

type TsTypPredicate struct {
	// contains filtered or unexported fields
}

[assertion](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions) and [type-predicates](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) have almost the same syntax so they'll share the same definition by using `assert` to distinguish them

#[visitor(Name,Typ)]

func (*TsTypPredicate) Asserts

func (n *TsTypPredicate) Asserts() bool

func (*TsTypPredicate) Name

func (n *TsTypPredicate) Name() Node

func (*TsTypPredicate) OuterParen

func (n *TsTypPredicate) OuterParen() span.Range

func (*TsTypPredicate) Range added in v0.0.10

func (n *TsTypPredicate) Range() span.Range

func (*TsTypPredicate) SetOuterParen

func (n *TsTypPredicate) SetOuterParen(rng span.Range)

func (*TsTypPredicate) Typ

func (n *TsTypPredicate) Typ() Node

func (*TsTypPredicate) Type

func (n *TsTypPredicate) Type() NodeType

type TsTypQuery

type TsTypQuery struct {
	// contains filtered or unexported fields
}

#[visitor(Arg)]

func (*TsTypQuery) Arg

func (n *TsTypQuery) Arg() Node

func (*TsTypQuery) OuterParen

func (n *TsTypQuery) OuterParen() span.Range

func (*TsTypQuery) Range added in v0.0.10

func (n *TsTypQuery) Range() span.Range

func (*TsTypQuery) SetOuterParen

func (n *TsTypQuery) SetOuterParen(rng span.Range)

func (*TsTypQuery) Type

func (n *TsTypQuery) Type() NodeType

type TsUnionTyp

type TsUnionTyp struct {
	// contains filtered or unexported fields
}

#[visitor(Elems)]

func (*TsUnionTyp) Elems

func (n *TsUnionTyp) Elems() []Node

func (*TsUnionTyp) OuterParen

func (n *TsUnionTyp) OuterParen() span.Range

func (*TsUnionTyp) Range added in v0.0.10

func (n *TsUnionTyp) Range() span.Range

func (*TsUnionTyp) SetOuterParen

func (n *TsUnionTyp) SetOuterParen(rng span.Range)

func (*TsUnionTyp) Type

func (n *TsUnionTyp) Type() NodeType

type TypInfo

type TypInfo struct {
	// contains filtered or unexported fields
}

func NewTypInfo

func NewTypInfo() *TypInfo

func (*TypInfo) Abstract

func (ti *TypInfo) Abstract() bool

func (*TypInfo) AccMod

func (ti *TypInfo) AccMod() ACC_MOD

func (*TypInfo) BeginRng added in v0.0.10

func (ti *TypInfo) BeginRng() span.Range

func (*TypInfo) Clone

func (ti *TypInfo) Clone() *TypInfo

func (*TypInfo) Declare

func (ti *TypInfo) Declare() bool

func (*TypInfo) Decorators

func (n *TypInfo) Decorators() []Node

func (*TypInfo) Definite

func (ti *TypInfo) Definite() bool

func (*TypInfo) Implements

func (ti *TypInfo) Implements() []Node

func (*TypInfo) Not

func (ti *TypInfo) Not(rng span.Range)

func (*TypInfo) Optional

func (ti *TypInfo) Optional() bool

func (*TypInfo) Override

func (ti *TypInfo) Override() bool

func (*TypInfo) Ques

func (ti *TypInfo) Ques() span.Range

func (*TypInfo) Readonly

func (ti *TypInfo) Readonly() bool

func (*TypInfo) SetAbstract

func (ti *TypInfo) SetAbstract(flag bool)

func (*TypInfo) SetAccMod

func (ti *TypInfo) SetAccMod(accMod ACC_MOD)

func (*TypInfo) SetBeginRng added in v0.0.10

func (ti *TypInfo) SetBeginRng(rng span.Range)

func (*TypInfo) SetDeclare

func (ti *TypInfo) SetDeclare(flag bool)

func (*TypInfo) SetImplements

func (ti *TypInfo) SetImplements(nodes []Node)

func (*TypInfo) SetNot

func (ti *TypInfo) SetNot(rng span.Range)

func (*TypInfo) SetOverride

func (ti *TypInfo) SetOverride(flag bool)

func (*TypInfo) SetQues

func (ti *TypInfo) SetQues(rng span.Range)

func (*TypInfo) SetReadonly

func (ti *TypInfo) SetReadonly(flag bool)

func (*TypInfo) SetSuperTypArgs

func (ti *TypInfo) SetSuperTypArgs(node Node)

func (*TypInfo) SetTypAnnot

func (ti *TypInfo) SetTypAnnot(node Node)

func (*TypInfo) SetTypArgs

func (ti *TypInfo) SetTypArgs(node Node)

func (*TypInfo) SetTypParams

func (ti *TypInfo) SetTypParams(node Node)

func (*TypInfo) SuperTypArgs

func (ti *TypInfo) SuperTypArgs() Node

func (*TypInfo) TypAnnot

func (ti *TypInfo) TypAnnot() *TsTypAnnot

func (*TypInfo) TypArgs

func (ti *TypInfo) TypArgs() Node

func (*TypInfo) TypParams

func (ti *TypInfo) TypParams() Node

type UnaryExpr

type UnaryExpr struct {
	// contains filtered or unexported fields
}

#[visitor(Arg)]

func (*UnaryExpr) Arg

func (n *UnaryExpr) Arg() Node

func (*UnaryExpr) Op

func (n *UnaryExpr) Op() TokenValue

func (*UnaryExpr) OpName added in v0.0.10

func (n *UnaryExpr) OpName() string

func (*UnaryExpr) OpText

func (n *UnaryExpr) OpText() string

func (*UnaryExpr) OuterParen

func (n *UnaryExpr) OuterParen() span.Range

func (*UnaryExpr) Range added in v0.0.10

func (n *UnaryExpr) Range() span.Range

func (*UnaryExpr) SetOuterParen

func (n *UnaryExpr) SetOuterParen(rng span.Range)

func (*UnaryExpr) Type

func (n *UnaryExpr) Type() NodeType

type UpdateExpr

type UpdateExpr struct {
	// contains filtered or unexported fields
}

#[visitor(Arg)]

func (*UpdateExpr) Arg

func (n *UpdateExpr) Arg() Node

func (*UpdateExpr) Op

func (n *UpdateExpr) Op() TokenValue

func (*UpdateExpr) OpText

func (n *UpdateExpr) OpText() string

func (*UpdateExpr) OuterParen

func (n *UpdateExpr) OuterParen() span.Range

func (*UpdateExpr) Prefix

func (n *UpdateExpr) Prefix() bool

func (*UpdateExpr) Range added in v0.0.10

func (n *UpdateExpr) Range() span.Range

func (*UpdateExpr) SetOuterParen

func (n *UpdateExpr) SetOuterParen(rng span.Range)

func (*UpdateExpr) Type

func (n *UpdateExpr) Type() NodeType

type VarDec

type VarDec struct {
	// contains filtered or unexported fields
}

#[visitor(Id,Init)]

func (*VarDec) Id

func (n *VarDec) Id() Node

func (*VarDec) Init

func (n *VarDec) Init() Node

func (*VarDec) Range added in v0.0.10

func (n *VarDec) Range() span.Range

func (*VarDec) Type

func (n *VarDec) Type() NodeType

type VarDecStmt

type VarDecStmt struct {
	// contains filtered or unexported fields
}

#[visitor(DecList)]

func (*VarDecStmt) DecList

func (n *VarDecStmt) DecList() []Node

func (*VarDecStmt) Kind

func (n *VarDecStmt) Kind() string

func (*VarDecStmt) Names

func (n *VarDecStmt) Names() []Node

func (*VarDecStmt) Range added in v0.0.10

func (n *VarDecStmt) Range() span.Range

func (*VarDecStmt) Type

func (n *VarDecStmt) Type() NodeType

type WhileStmt

type WhileStmt struct {
	// contains filtered or unexported fields
}

#[visitor(PUSH_SCOPE,Test,Body)]

func (*WhileStmt) Body

func (n *WhileStmt) Body() Node

func (*WhileStmt) Range added in v0.0.10

func (n *WhileStmt) Range() span.Range

func (*WhileStmt) Test

func (n *WhileStmt) Test() Node

func (*WhileStmt) Type

func (n *WhileStmt) Type() NodeType

type WithStmt

type WithStmt struct {
	// contains filtered or unexported fields
}

#[visitor(Expr,Body)]

func (*WithStmt) Body

func (n *WithStmt) Body() Node

func (*WithStmt) Expr

func (n *WithStmt) Expr() Node

func (*WithStmt) Range added in v0.0.10

func (n *WithStmt) Range() span.Range

func (*WithStmt) Type

func (n *WithStmt) Type() NodeType

type YieldExpr

type YieldExpr struct {
	// contains filtered or unexported fields
}

#[visitor(Arg)]

func (*YieldExpr) Arg

func (n *YieldExpr) Arg() Node

func (*YieldExpr) Delegate

func (n *YieldExpr) Delegate() bool

func (*YieldExpr) OuterParen

func (n *YieldExpr) OuterParen() span.Range

func (*YieldExpr) Range added in v0.0.10

func (n *YieldExpr) Range() span.Range

func (*YieldExpr) SetOuterParen

func (n *YieldExpr) SetOuterParen(rng span.Range)

func (*YieldExpr) Type

func (n *YieldExpr) Type() NodeType

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL