ast

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fprint

func Fprint(w io.Writer, fset *token.FileSet, x any, f FieldFilter) error

Fprint prints the (sub-)tree starting at AST node x to w. If fset != nil, position information is interpreted relative to that file set. Otherwise positions are printed as integer values (file set specific offsets).

A non-nil FieldFilter f may be provided to control the output: struct fields for which f(fieldname, fieldvalue) is true are printed; all others are filtered from the output. Unexported struct fields are never printed.

func IsExported

func IsExported(name string) bool

IsExported reports whether name starts with an upper-case letter.

func ModuleName

func ModuleName(specifier string) (name string, err error)

func NotNilFilter

func NotNilFilter(_ string, v reflect.Value) bool

NotNilFilter returns true for field values that are not nil; it returns false otherwise.

func Print

func Print(fset *token.FileSet, x any) error

Print prints x to standard output, skipping nil fields. Print(fset, x) is the same as Fprint(os.Stdout, fset, x, NotNilFilter).

Types

type ArrayInitializer

type ArrayInitializer struct {
	Opening token.Pos
	Value   Expr
	Semi    token.Pos
	Count   Expr
	Closing token.Pos
}

func (*ArrayInitializer) End

func (x *ArrayInitializer) End() token.Pos

func (*ArrayInitializer) Flatten

func (x *ArrayInitializer) Flatten() []Node

func (*ArrayInitializer) Pos

func (x *ArrayInitializer) Pos() token.Pos

type ArrayLiteral

type ArrayLiteral struct {
	Opening token.Pos
	List    []Expr
	Closing token.Pos
}

func (*ArrayLiteral) End

func (x *ArrayLiteral) End() token.Pos

func (*ArrayLiteral) Flatten

func (x *ArrayLiteral) Flatten() []Node

func (*ArrayLiteral) Pos

func (x *ArrayLiteral) Pos() token.Pos

type AssignStmt

type AssignStmt struct {
	Lhs    Expr
	TokPos token.Pos
	Tok    token.Token
	Rhs    Expr
}

func (*AssignStmt) End

func (s *AssignStmt) End() token.Pos

func (*AssignStmt) Flatten

func (s *AssignStmt) Flatten() []Node

func (*AssignStmt) Pos

func (s *AssignStmt) Pos() token.Pos

type AwaitExpr

type AwaitExpr struct {
	Await token.Pos
	X     Expr
}

func (*AwaitExpr) End

func (x *AwaitExpr) End() token.Pos

func (*AwaitExpr) Flatten

func (x *AwaitExpr) Flatten() []Node

func (*AwaitExpr) Pos

func (x *AwaitExpr) Pos() token.Pos

type BadExpr

type BadExpr struct {
	From, To token.Pos
}

func (*BadExpr) End

func (x *BadExpr) End() token.Pos

func (*BadExpr) Flatten

func (x *BadExpr) Flatten() []Node

func (*BadExpr) Pos

func (x *BadExpr) Pos() token.Pos

type BadStmt

type BadStmt struct {
	From, To token.Pos
}

func (*BadStmt) End

func (s *BadStmt) End() token.Pos

func (*BadStmt) Flatten

func (s *BadStmt) Flatten() []Node

func (*BadStmt) Pos

func (s *BadStmt) Pos() token.Pos

type BinaryExpr

type BinaryExpr struct {
	X     Expr
	OpPos token.Pos
	Op    token.Token
	Y     Expr
}

func (*BinaryExpr) End

func (x *BinaryExpr) End() token.Pos

func (*BinaryExpr) Flatten

func (x *BinaryExpr) Flatten() []Node

func (*BinaryExpr) Pos

func (x *BinaryExpr) Pos() token.Pos

type BindExpr

type BindExpr struct {
	X   Expr
	Sel Expr
}

func (*BindExpr) End

func (x *BindExpr) End() token.Pos

func (*BindExpr) Flatten

func (x *BindExpr) Flatten() []Node

func (*BindExpr) Pos

func (x *BindExpr) Pos() token.Pos

type BracketPropertyExpr

type BracketPropertyExpr struct {
	HashLBracket token.Pos
	X            Expr
	RBracket     token.Pos
}

func (*BracketPropertyExpr) End

func (x *BracketPropertyExpr) End() token.Pos

func (*BracketPropertyExpr) Flatten

func (x *BracketPropertyExpr) Flatten() []Node

func (*BracketPropertyExpr) Pos

func (x *BracketPropertyExpr) Pos() token.Pos

type BracketSelectorExpr

type BracketSelectorExpr struct {
	X      Expr
	LBrack token.Pos
	Sel    Expr
	RBrack token.Pos
}

func (*BracketSelectorExpr) End

func (x *BracketSelectorExpr) End() token.Pos

func (*BracketSelectorExpr) Flatten

func (x *BracketSelectorExpr) Flatten() []Node

func (*BracketSelectorExpr) Pos

func (x *BracketSelectorExpr) Pos() token.Pos

type BranchStmt

type BranchStmt struct {
	TokPos token.Pos
	Tok    token.Token
	Label  *Ident
}

func (*BranchStmt) End

func (s *BranchStmt) End() token.Pos

func (*BranchStmt) Flatten

func (s *BranchStmt) Flatten() []Node

func (*BranchStmt) Pos

func (s *BranchStmt) Pos() token.Pos

type CallExpr

type CallExpr struct {
	Func   Expr
	LParen token.Pos
	Args   []Expr
	RParen token.Pos
}

func (*CallExpr) End

func (x *CallExpr) End() token.Pos

func (*CallExpr) Flatten

func (x *CallExpr) Flatten() []Node

func (*CallExpr) Pos

func (x *CallExpr) Pos() token.Pos

type CatchStmt

type CatchStmt struct {
	Catch    token.Pos
	Ident    *Ident
	Body     []Stmt
	BlockEnd token.Pos
}

func (*CatchStmt) End

func (s *CatchStmt) End() token.Pos

func (*CatchStmt) Flatten

func (s *CatchStmt) Flatten() []Node

func (*CatchStmt) Pos

func (s *CatchStmt) Pos() token.Pos

type Comment

type Comment struct {
	Slash token.Pos
	Text  string
}

func (*Comment) End

func (c *Comment) End() token.Pos

func (*Comment) Pos

func (c *Comment) Pos() token.Pos

type CommentGroup

type CommentGroup struct{ List []*Comment }

func (*CommentGroup) End

func (g *CommentGroup) End() token.Pos

func (*CommentGroup) Pos

func (g *CommentGroup) Pos() token.Pos

func (*CommentGroup) Text

func (g *CommentGroup) Text() string

type CompositeField

type CompositeField struct {
	Key   Expr
	Value Expr
}

type CompositeLiteral

type CompositeLiteral struct {
	Lbrace token.Pos
	Fields []*CompositeField
	Rbrace token.Pos
}

func (*CompositeLiteral) End

func (x *CompositeLiteral) End() token.Pos

func (*CompositeLiteral) Flatten

func (x *CompositeLiteral) Flatten() []Node

func (*CompositeLiteral) Pos

func (x *CompositeLiteral) Pos() token.Pos

type ConstStmt

type ConstStmt struct {
	ConstPos token.Pos
	Ident    *Ident
	TokPos   token.Pos
	Value    Expr
}

func (*ConstStmt) End

func (s *ConstStmt) End() token.Pos

func (*ConstStmt) Flatten

func (s *ConstStmt) Flatten() []Node

func (*ConstStmt) Pos

func (s *ConstStmt) Pos() token.Pos

type DoExpr

type DoExpr struct {
	Do       token.Pos
	Body     []Stmt
	BlockEnd token.Pos
}

func (*DoExpr) End

func (s *DoExpr) End() token.Pos

func (*DoExpr) Flatten

func (s *DoExpr) Flatten() []Node

func (*DoExpr) Pos

func (s *DoExpr) Pos() token.Pos

type EllipsisExpr

type EllipsisExpr struct {
	Ellipsis token.Pos
	X        Expr
}

func (*EllipsisExpr) End

func (x *EllipsisExpr) End() token.Pos

func (*EllipsisExpr) Flatten

func (x *EllipsisExpr) Flatten() []Node

func (*EllipsisExpr) Pos

func (x *EllipsisExpr) Pos() token.Pos

type EmptyStmt

type EmptyStmt struct {
}

func (*EmptyStmt) End

func (s *EmptyStmt) End() token.Pos

func (*EmptyStmt) Flatten

func (s *EmptyStmt) Flatten() []Node

func (*EmptyStmt) Pos

func (s *EmptyStmt) Pos() token.Pos

type ExportDeclStmt

type ExportDeclStmt struct {
	Export token.Pos
	Stmt   Stmt
}

func (*ExportDeclStmt) End

func (s *ExportDeclStmt) End() token.Pos

func (*ExportDeclStmt) Flatten

func (s *ExportDeclStmt) Flatten() []Node

func (*ExportDeclStmt) Pos

func (s *ExportDeclStmt) Pos() token.Pos

type ExportField

type ExportField interface {
	Node
	// contains filtered or unexported methods
}

type ExportFieldAs

type ExportFieldAs struct {
	Ident *Ident
	As    token.Pos
	Alias *Ident
}

export "foo" show { foo as foo2 }

func (*ExportFieldAs) End

func (s *ExportFieldAs) End() token.Pos

func (*ExportFieldAs) Flatten

func (s *ExportFieldAs) Flatten() []Node

func (*ExportFieldAs) Pos

func (s *ExportFieldAs) Pos() token.Pos

type ExportFieldIdent

type ExportFieldIdent struct {
	Ident *Ident
}

export "foo" show { foo }

func (*ExportFieldIdent) End

func (s *ExportFieldIdent) End() token.Pos

func (*ExportFieldIdent) Flatten

func (s *ExportFieldIdent) Flatten() []Node

func (*ExportFieldIdent) Pos

func (s *ExportFieldIdent) Pos() token.Pos

type ExportList

type ExportList struct {
	LBrace token.Pos
	Fields []ExportField
	RBrace token.Pos
}

func (*ExportList) End

func (s *ExportList) End() token.Pos

func (*ExportList) Flatten

func (s *ExportList) Flatten() []Node

func (*ExportList) Pos

func (s *ExportList) Pos() token.Pos

type ExportListStmt

type ExportListStmt struct {
	Export token.Pos
	List   *ExportList
}

func (*ExportListStmt) End

func (s *ExportListStmt) End() token.Pos

func (*ExportListStmt) Flatten

func (s *ExportListStmt) Flatten() []Node

func (*ExportListStmt) Pos

func (s *ExportListStmt) Pos() token.Pos

type ExportSpecStmt

type ExportSpecStmt struct {
	Export token.Pos
	Spec   ModuleSpec
}

func (*ExportSpecStmt) End

func (s *ExportSpecStmt) End() token.Pos

func (*ExportSpecStmt) Flatten

func (s *ExportSpecStmt) Flatten() []Node

func (*ExportSpecStmt) Pos

func (s *ExportSpecStmt) Pos() token.Pos

type Expr

type Expr interface {
	Node
	// contains filtered or unexported methods
}

type ExprStmt

type ExprStmt struct {
	X Expr
}

func (*ExprStmt) End

func (s *ExprStmt) End() token.Pos

func (*ExprStmt) Flatten

func (s *ExprStmt) Flatten() []Node

func (*ExprStmt) Pos

func (s *ExprStmt) Pos() token.Pos

type FieldFilter

type FieldFilter func(name string, value reflect.Value) bool

A FieldFilter may be provided to Fprint to control the output.

type FinallyStmt

type FinallyStmt struct {
	Finally  token.Pos
	Body     []Stmt
	BlockEnd token.Pos
}

func (*FinallyStmt) End

func (s *FinallyStmt) End() token.Pos

func (*FinallyStmt) Flatten

func (s *FinallyStmt) Flatten() []Node

func (*FinallyStmt) Pos

func (s *FinallyStmt) Pos() token.Pos

type ForStmt

type ForStmt struct {
	For      token.Pos
	Await    token.Pos
	Var      *Ident
	Iterable Expr
	Body     []Stmt
	BlockEnd token.Pos
}

func (*ForStmt) End

func (s *ForStmt) End() token.Pos

func (*ForStmt) Flatten

func (s *ForStmt) Flatten() []Node

func (*ForStmt) Pos

func (s *ForStmt) Pos() token.Pos

type FrozenExpr

type FrozenExpr struct {
	Frozen token.Pos
	X      Expr
}

func (*FrozenExpr) End

func (x *FrozenExpr) End() token.Pos

func (*FrozenExpr) Flatten

func (x *FrozenExpr) Flatten() []Node

func (*FrozenExpr) Pos

func (x *FrozenExpr) Pos() token.Pos

type FuncExpr

type FuncExpr struct {
	Async    token.Pos
	Memo     token.Pos
	Func     token.Pos
	Receiver *Ident
	Name     *Ident
	Params   *FuncParamList

	Arrow     token.Pos
	ArrowExpr Expr

	Body     []Stmt
	BlockEnd token.Pos
}

func (*FuncExpr) End

func (s *FuncExpr) End() token.Pos

func (*FuncExpr) Flatten

func (f *FuncExpr) Flatten() []Node

func (*FuncExpr) Pos

func (s *FuncExpr) Pos() token.Pos

type FuncParam

type FuncParam struct {
	Ellipsis token.Pos
	Ident    *Ident
	Value    Expr
}

func (*FuncParam) End

func (f *FuncParam) End() token.Pos

func (*FuncParam) Flatten

func (f *FuncParam) Flatten() []Node

func (*FuncParam) Pos

func (f *FuncParam) Pos() token.Pos

type FuncParamList

type FuncParamList struct {
	Opening token.Pos
	List    []*FuncParam
	Closing token.Pos
}

func (*FuncParamList) End

func (f *FuncParamList) End() token.Pos

func (*FuncParamList) Flatten

func (f *FuncParamList) Flatten() []Node

func (*FuncParamList) NumFields

func (f *FuncParamList) NumFields() int

func (*FuncParamList) Pos

func (f *FuncParamList) Pos() token.Pos

type GeneratorExpr

type GeneratorExpr struct {
	Async     token.Pos
	Generator token.Pos
	Receiver  *Ident
	Name      *Ident
	Params    *FuncParamList
	Body      []Stmt
	BlockEnd  token.Pos
}

func (*GeneratorExpr) End

func (s *GeneratorExpr) End() token.Pos

func (*GeneratorExpr) Flatten

func (s *GeneratorExpr) Flatten() []Node

func (*GeneratorExpr) Pos

func (s *GeneratorExpr) Pos() token.Pos

type Ident

type Ident struct {
	NamePos token.Pos
	Name    string
}

func (*Ident) End

func (x *Ident) End() token.Pos

func (*Ident) Flatten

func (x *Ident) Flatten() []Node

func (*Ident) Pos

func (x *Ident) Pos() token.Pos

func (*Ident) String

func (id *Ident) String() string

type IfExpr

type IfExpr struct {
	If      token.Pos
	Cond    Expr
	ThenPos token.Pos
	Then    Expr
	ElsePos token.Pos
	Else    Expr
}

func (*IfExpr) End

func (e *IfExpr) End() token.Pos

func (*IfExpr) Flatten

func (e *IfExpr) Flatten() []Node

func (*IfExpr) Pos

func (e *IfExpr) Pos() token.Pos

type IfStmt

type IfStmt struct {
	If       token.Pos
	Cond     Expr
	Body     []Stmt
	Else     []Stmt
	BlockEnd token.Pos
}

func (*IfStmt) End

func (s *IfStmt) End() token.Pos

func (*IfStmt) Flatten

func (s *IfStmt) Flatten() []Node

func (*IfStmt) Pos

func (s *IfStmt) Pos() token.Pos

type ImportStmt

type ImportStmt struct {
	Import token.Pos
	Spec   ModuleSpec
}

func (*ImportStmt) End

func (s *ImportStmt) End() token.Pos

func (*ImportStmt) Flatten

func (s *ImportStmt) Flatten() []Node

func (*ImportStmt) Pos

func (s *ImportStmt) Pos() token.Pos

type IncDecStmt

type IncDecStmt struct {
	X      Expr
	TokPos token.Pos
	Tok    token.Token
}

func (*IncDecStmt) End

func (s *IncDecStmt) End() token.Pos

func (*IncDecStmt) Flatten

func (s *IncDecStmt) Flatten() []Node

func (*IncDecStmt) Pos

func (s *IncDecStmt) Pos() token.Pos

type KeyValueExpr

type KeyValueExpr struct {
	Key   Expr
	Colon token.Pos
	Value Expr
}

func (*KeyValueExpr) End

func (x *KeyValueExpr) End() token.Pos

func (*KeyValueExpr) Flatten

func (x *KeyValueExpr) Flatten() []Node

func (*KeyValueExpr) Pos

func (x *KeyValueExpr) Pos() token.Pos

type LabeledStmt

type LabeledStmt struct {
	Label *Ident
	Colon token.Pos
	Stmt  Stmt
}

func (*LabeledStmt) End

func (s *LabeledStmt) End() token.Pos

func (*LabeledStmt) Flatten

func (s *LabeledStmt) Flatten() []Node

func (*LabeledStmt) Pos

func (s *LabeledStmt) Pos() token.Pos

type LetStmt

type LetStmt struct {
	LetPos token.Pos
	Ident  *Ident
	TokPos token.Pos
	Value  Expr
}

func (*LetStmt) End

func (s *LetStmt) End() token.Pos

func (*LetStmt) Flatten

func (s *LetStmt) Flatten() []Node

func (*LetStmt) Pos

func (s *LetStmt) Pos() token.Pos

type Literal

type Literal struct {
	ValuePos token.Pos
	Kind     token.Token
	Value    string
}

func (*Literal) End

func (x *Literal) End() token.Pos

func (*Literal) Flatten

func (s *Literal) Flatten() []Node

func (*Literal) Pos

func (x *Literal) Pos() token.Pos

type MatchArm

type MatchArm interface {
	Node
	// contains filtered or unexported methods
}

type MatchElse

type MatchElse struct {
	Else  token.Pos
	Arrow token.Pos
	Expr  Expr
}

func (*MatchElse) End

func (x *MatchElse) End() token.Pos

func (*MatchElse) Flatten

func (x *MatchElse) Flatten() []Node

func (*MatchElse) Pos

func (x *MatchElse) Pos() token.Pos

type MatchExpr

type MatchExpr struct {
	Match    token.Pos
	Expr     Expr
	Clauses  []MatchArm
	BlockEnd token.Pos
}

func (*MatchExpr) End

func (x *MatchExpr) End() token.Pos

func (*MatchExpr) Flatten

func (x *MatchExpr) Flatten() []Node

func (*MatchExpr) Pos

func (x *MatchExpr) Pos() token.Pos

type MatchPattern

type MatchPattern struct {
	Pattern PatternExpr
	Arrow   token.Pos
	Expr    Expr
}

func (*MatchPattern) End

func (x *MatchPattern) End() token.Pos

func (*MatchPattern) Flatten

func (x *MatchPattern) Flatten() []Node

func (*MatchPattern) Pos

func (x *MatchPattern) Pos() token.Pos

type Module

type Module struct {
	Type      ModuleType
	Specifier string
	Scheme    string

	Size  int
	Stmts []Stmt
	Nodes []Node
}

func (*Module) End

func (m *Module) End() token.Pos

func (*Module) FindNode

func (m *Module) FindNode(pos token.Pos) Node

func (*Module) Flatten

func (m *Module) Flatten() []Node

func (*Module) Pos

func (m *Module) Pos() token.Pos

type ModuleSpec

type ModuleSpec interface {
	Node

	ModuleSpecifier() string
	// contains filtered or unexported methods
}

type ModuleSpecAs

type ModuleSpecAs struct {
	SpecifierPos token.Pos
	Specifier    string
	As           token.Pos
	Alias        *Ident
}

func (*ModuleSpecAs) End

func (s *ModuleSpecAs) End() token.Pos

func (*ModuleSpecAs) Flatten

func (s *ModuleSpecAs) Flatten() []Node

func (*ModuleSpecAs) ModuleSpecifier

func (s *ModuleSpecAs) ModuleSpecifier() string

func (*ModuleSpecAs) Pos

func (s *ModuleSpecAs) Pos() token.Pos

type ModuleSpecPlain

type ModuleSpecPlain struct {
	SpecifierPos token.Pos
	Specifier    string
}

func (*ModuleSpecPlain) End

func (s *ModuleSpecPlain) End() token.Pos

func (*ModuleSpecPlain) Flatten

func (s *ModuleSpecPlain) Flatten() []Node

func (*ModuleSpecPlain) ModuleSpecifier

func (s *ModuleSpecPlain) ModuleSpecifier() string

func (*ModuleSpecPlain) Pos

func (s *ModuleSpecPlain) Pos() token.Pos

type ModuleSpecShow

type ModuleSpecShow struct {
	SpecifierPos token.Pos
	Specifier    string
	Show         *Show
}

func (*ModuleSpecShow) End

func (s *ModuleSpecShow) End() token.Pos

func (*ModuleSpecShow) Flatten

func (s *ModuleSpecShow) Flatten() []Node

func (*ModuleSpecShow) ModuleSpecifier

func (s *ModuleSpecShow) ModuleSpecifier() string

func (*ModuleSpecShow) Pos

func (s *ModuleSpecShow) Pos() token.Pos

type ModuleType

type ModuleType int
const (
	ModuleTypeFilesystem ModuleType = iota
	ModuleTypeMemory
	ModuleTypeNetwork
)

type NativeConst

type NativeConst struct {
	Native token.Pos
	Const  token.Pos
	Ident  *Ident
}

func (*NativeConst) End

func (s *NativeConst) End() token.Pos

func (*NativeConst) Flatten

func (s *NativeConst) Flatten() []Node

func (*NativeConst) Pos

func (s *NativeConst) Pos() token.Pos

type NativeExpr

type NativeExpr struct {
	Native token.Pos
	Id     string
}

func (*NativeExpr) End

func (s *NativeExpr) End() token.Pos

func (*NativeExpr) Flatten

func (s *NativeExpr) Flatten() []Node

func (*NativeExpr) Pos

func (s *NativeExpr) Pos() token.Pos

type NativeFunc

type NativeFunc struct {
	Native   token.Pos
	Async    token.Pos
	Memo     token.Pos
	Fn       token.Pos
	Receiver *Ident
	Name     *Ident
	Params   *FuncParamList
}

func (*NativeFunc) End

func (s *NativeFunc) End() token.Pos

func (*NativeFunc) Flatten

func (s *NativeFunc) Flatten() []Node

func (*NativeFunc) Pos

func (s *NativeFunc) Pos() token.Pos

type NativeOperator

type NativeOperator struct {
	Native   token.Pos
	Async    token.Pos
	Operator token.Pos
	Receiver *Ident
	TokPos   token.Pos
	Tok      token.Token
	Params   *FuncParamList
}

func (*NativeOperator) End

func (s *NativeOperator) End() token.Pos

func (*NativeOperator) Flatten

func (s *NativeOperator) Flatten() []Node

func (*NativeOperator) Pos

func (s *NativeOperator) Pos() token.Pos

type NativeStmt

type NativeStmt interface {
	Stmt
	// contains filtered or unexported methods
}

type NativeStruct

type NativeStruct struct {
	Native token.Pos
	Struct token.Pos
	Name   *Ident
	Fields *StructFieldList
}

func (*NativeStruct) End

func (s *NativeStruct) End() token.Pos

func (*NativeStruct) Flatten

func (s *NativeStruct) Flatten() []Node

func (*NativeStruct) Pos

func (s *NativeStruct) Pos() token.Pos

type Node

type Node interface {
	Pos() token.Pos
	End() token.Pos
	Flatten() []Node
}

type NodePrinter

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

func (*NodePrinter) Print

func (p *NodePrinter) Print(node Node)

func (*NodePrinter) String

func (p *NodePrinter) String() string

type OperatorStmt

type OperatorStmt struct {
	Async     token.Pos
	Operator  token.Pos
	Receiver  *Ident
	TokPos    token.Pos
	Tok       token.Token
	Params    *FuncParamList
	Arrow     token.Pos
	ArrowExpr Expr
	Body      []Stmt
	BlockEnd  token.Pos
}

func (*OperatorStmt) End

func (x *OperatorStmt) End() token.Pos

func (*OperatorStmt) Flatten

func (x *OperatorStmt) Flatten() []Node

func (*OperatorStmt) Pos

func (x *OperatorStmt) Pos() token.Pos

type ParenExpr

type ParenExpr struct {
	Lparen token.Pos
	X      Expr
	Rparen token.Pos
}

func (*ParenExpr) End

func (x *ParenExpr) End() token.Pos

func (*ParenExpr) Flatten

func (x *ParenExpr) Flatten() []Node

func (*ParenExpr) Pos

func (x *ParenExpr) Pos() token.Pos

type PatternBinding

type PatternBinding struct {
	Bind  token.Pos
	Ident *Ident
}

func (*PatternBinding) End

func (x *PatternBinding) End() token.Pos

func (*PatternBinding) Flatten

func (x *PatternBinding) Flatten() []Node

func (*PatternBinding) Pos

func (x *PatternBinding) Pos() token.Pos

type PatternComposite

type PatternComposite struct {
	Opening token.Pos
	Fields  []*PatternCompositeField
	Closing token.Pos
}

func (*PatternComposite) End

func (x *PatternComposite) End() token.Pos

func (*PatternComposite) Flatten

func (x *PatternComposite) Flatten() []Node

func (*PatternComposite) Pos

func (x *PatternComposite) Pos() token.Pos

type PatternCompositeField

type PatternCompositeField struct {
	Key   PatternExpr
	Colon token.Pos
	Value PatternExpr
}

type PatternExpr

type PatternExpr interface {
	Node
	// contains filtered or unexported methods
}

type PatternNormal

type PatternNormal struct {
	X Expr
}

func (*PatternNormal) End

func (x *PatternNormal) End() token.Pos

func (*PatternNormal) Flatten

func (x *PatternNormal) Flatten() []Node

func (*PatternNormal) Pos

func (x *PatternNormal) Pos() token.Pos

type PatternParen

type PatternParen struct {
	LParen token.Pos
	X      PatternExpr
	RParen token.Pos
}

func (*PatternParen) End

func (x *PatternParen) End() token.Pos

func (*PatternParen) Flatten

func (x *PatternParen) Flatten() []Node

func (*PatternParen) Pos

func (x *PatternParen) Pos() token.Pos

type PatternRange

type PatternRange struct {
	Start Expr
	To    token.Pos
	Stop  Expr
}

func (*PatternRange) End

func (x *PatternRange) End() token.Pos

func (*PatternRange) Flatten

func (x *PatternRange) Flatten() []Node

func (*PatternRange) Pos

func (x *PatternRange) Pos() token.Pos

type PatternTuple

type PatternTuple struct {
	Opening token.Pos
	List    []PatternExpr
	Closing token.Pos
}

func (*PatternTuple) End

func (x *PatternTuple) End() token.Pos

func (*PatternTuple) Flatten

func (x *PatternTuple) Flatten() []Node

func (*PatternTuple) Pos

func (x *PatternTuple) Pos() token.Pos

type PatternType

type PatternType struct {
	Ident   *Ident
	Opening token.Pos
	Binding PatternBinding
	Closing token.Pos
}

func (*PatternType) End

func (x *PatternType) End() token.Pos

func (*PatternType) Flatten

func (x *PatternType) Flatten() []Node

func (*PatternType) Pos

func (x *PatternType) Pos() token.Pos

type PosRange

type PosRange struct {
	From token.Pos
	To   token.Pos
}

func (PosRange) End

func (p PosRange) End() token.Pos

func (PosRange) Pos

func (p PosRange) Pos() token.Pos

type PropertyExpr

type PropertyExpr struct {
	Hash  token.Pos
	Ident *Ident
}

func (*PropertyExpr) End

func (x *PropertyExpr) End() token.Pos

func (*PropertyExpr) Flatten

func (x *PropertyExpr) Flatten() []Node

func (*PropertyExpr) Pos

func (x *PropertyExpr) Pos() token.Pos

type RangeExpr

type RangeExpr struct {
	Start   Expr
	ToPos   token.Pos
	Stop    Expr
	StepPos token.Pos
	Step    Expr
}

func (*RangeExpr) End

func (x *RangeExpr) End() token.Pos

func (*RangeExpr) Flatten

func (x *RangeExpr) Flatten() []Node

func (*RangeExpr) Pos

func (x *RangeExpr) Pos() token.Pos

type RepeatCountStmt

type RepeatCountStmt struct {
	Repeat   token.Pos
	Count    Expr
	Times    token.Pos
	Body     []Stmt
	BlockEnd token.Pos
}

func (*RepeatCountStmt) End

func (s *RepeatCountStmt) End() token.Pos

func (*RepeatCountStmt) Flatten

func (s *RepeatCountStmt) Flatten() []Node

func (*RepeatCountStmt) Pos

func (s *RepeatCountStmt) Pos() token.Pos

type RepeatForeverStmt

type RepeatForeverStmt struct {
	Repeat   token.Pos
	Forever  token.Pos
	Body     []Stmt
	BlockEnd token.Pos
}

func (*RepeatForeverStmt) End

func (s *RepeatForeverStmt) End() token.Pos

func (*RepeatForeverStmt) Flatten

func (s *RepeatForeverStmt) Flatten() []Node

func (*RepeatForeverStmt) Pos

func (s *RepeatForeverStmt) Pos() token.Pos

type RepeatWhileStmt

type RepeatWhileStmt struct {
	Repeat   token.Pos
	While    token.Pos
	Cond     Expr
	Body     []Stmt
	BlockEnd token.Pos
}

func (*RepeatWhileStmt) End

func (s *RepeatWhileStmt) End() token.Pos

func (*RepeatWhileStmt) Flatten

func (s *RepeatWhileStmt) Flatten() []Node

func (*RepeatWhileStmt) Pos

func (s *RepeatWhileStmt) Pos() token.Pos

type ReturnStmt

type ReturnStmt struct {
	Return token.Pos
	Result Expr
}

func (*ReturnStmt) End

func (s *ReturnStmt) End() token.Pos

func (*ReturnStmt) Flatten

func (f *ReturnStmt) Flatten() []Node

func (*ReturnStmt) Pos

func (s *ReturnStmt) Pos() token.Pos

type SelectorExpr

type SelectorExpr struct {
	X   Expr
	Sel *Ident
}

func (*SelectorExpr) End

func (x *SelectorExpr) End() token.Pos

func (*SelectorExpr) Flatten

func (x *SelectorExpr) Flatten() []Node

func (*SelectorExpr) Pos

func (x *SelectorExpr) Pos() token.Pos

type Show

type Show struct {
	Show token.Pos

	// import "foo" show ...
	Ellipsis token.Pos

	LBrace token.Pos
	Fields []ShowField
	RBrace token.Pos
}

func (*Show) End

func (s *Show) End() token.Pos

func (*Show) Flatten

func (s *Show) Flatten() []Node

func (*Show) Pos

func (s *Show) Pos() token.Pos

type ShowField

type ShowField interface {
	Node
	// contains filtered or unexported methods
}

type ShowFieldAs

type ShowFieldAs struct {
	Ident *Ident
	As    token.Pos
	Alias *Ident
}

import "foo" show { foo as foo2 }

func (*ShowFieldAs) End

func (s *ShowFieldAs) End() token.Pos

func (*ShowFieldAs) Flatten

func (s *ShowFieldAs) Flatten() []Node

func (*ShowFieldAs) Pos

func (s *ShowFieldAs) Pos() token.Pos

type ShowFieldEllipsis

type ShowFieldEllipsis struct {
	Ellipsis token.Pos
	Ident    *Ident
}

import "foo" show { ...foo }

func (*ShowFieldEllipsis) End

func (s *ShowFieldEllipsis) End() token.Pos

func (*ShowFieldEllipsis) Flatten

func (s *ShowFieldEllipsis) Flatten() []Node

func (*ShowFieldEllipsis) Pos

func (s *ShowFieldEllipsis) Pos() token.Pos

type ShowFieldIdent

type ShowFieldIdent struct {
	Ident *Ident
}

import "foo" show { foo }

func (*ShowFieldIdent) End

func (s *ShowFieldIdent) End() token.Pos

func (*ShowFieldIdent) Flatten

func (s *ShowFieldIdent) Flatten() []Node

func (*ShowFieldIdent) Pos

func (s *ShowFieldIdent) Pos() token.Pos

type ShowFieldSpec

type ShowFieldSpec struct {
	Spec ModuleSpec
}

import "foo" show { "utils", "utils" as fooUtils, "utils" show { foo } }

func (*ShowFieldSpec) End

func (s *ShowFieldSpec) End() token.Pos

func (*ShowFieldSpec) Flatten

func (s *ShowFieldSpec) Flatten() []Node

func (*ShowFieldSpec) Pos

func (s *ShowFieldSpec) Pos() token.Pos

type SliceExpr

type SliceExpr struct {
	X      Expr
	LBrack token.Pos
	Low    Expr
	High   Expr
	RBrack token.Pos
}

func (*SliceExpr) End

func (x *SliceExpr) End() token.Pos

func (*SliceExpr) Flatten

func (x *SliceExpr) Flatten() []Node

func (*SliceExpr) Pos

func (x *SliceExpr) Pos() token.Pos

type Stmt

type Stmt interface {
	Node
	// contains filtered or unexported methods
}

type StringLiteral

type StringLiteral struct {
	StringStart *StringLiteralStart
	Parts       []StringLiteralPart
	StringEnd   *StringLiteralEnd
}

func (*StringLiteral) End

func (x *StringLiteral) End() token.Pos

func (*StringLiteral) Flatten

func (s *StringLiteral) Flatten() []Node

func (*StringLiteral) Pos

func (x *StringLiteral) Pos() token.Pos

func (*StringLiteral) String

func (s *StringLiteral) String() string

type StringLiteralEnd

type StringLiteralEnd struct {
	StartPos token.Pos
	Content  string
	Quote    token.Pos
}

func (*StringLiteralEnd) End

func (x *StringLiteralEnd) End() token.Pos

func (*StringLiteralEnd) Flatten

func (s *StringLiteralEnd) Flatten() []Node

func (*StringLiteralEnd) Pos

func (x *StringLiteralEnd) Pos() token.Pos

type StringLiteralInterpExpr

type StringLiteralInterpExpr struct {
	InterpPos token.Pos
	Expr      Expr
}

func (*StringLiteralInterpExpr) End

func (*StringLiteralInterpExpr) Flatten

func (s *StringLiteralInterpExpr) Flatten() []Node

func (*StringLiteralInterpExpr) Pos

type StringLiteralInterpIdent

type StringLiteralInterpIdent struct {
	InterpPos token.Pos
	Ident     *Ident
}

func (*StringLiteralInterpIdent) End

func (*StringLiteralInterpIdent) Flatten

func (s *StringLiteralInterpIdent) Flatten() []Node

func (*StringLiteralInterpIdent) Pos

type StringLiteralMiddle

type StringLiteralMiddle struct {
	StartPos token.Pos
	Content  string
}

func (*StringLiteralMiddle) End

func (x *StringLiteralMiddle) End() token.Pos

func (*StringLiteralMiddle) Flatten

func (s *StringLiteralMiddle) Flatten() []Node

func (*StringLiteralMiddle) Pos

func (x *StringLiteralMiddle) Pos() token.Pos

type StringLiteralPart

type StringLiteralPart interface {
	Node
	// contains filtered or unexported methods
}

type StringLiteralStart

type StringLiteralStart struct {
	Quote   token.Pos
	Content string
}

func (*StringLiteralStart) End

func (x *StringLiteralStart) End() token.Pos

func (*StringLiteralStart) Flatten

func (s *StringLiteralStart) Flatten() []Node

func (*StringLiteralStart) Pos

func (x *StringLiteralStart) Pos() token.Pos

type StructField

type StructField struct {
	Ident *Ident
	Value Expr
}

func (*StructField) End

func (f *StructField) End() token.Pos

func (*StructField) Flatten

func (f *StructField) Flatten() []Node

func (*StructField) Pos

func (f *StructField) Pos() token.Pos

type StructFieldList

type StructFieldList struct {
	Opening token.Pos
	List    []*StructField
	Closing token.Pos
}

func (*StructFieldList) End

func (f *StructFieldList) End() token.Pos

func (*StructFieldList) NumFields

func (f *StructFieldList) NumFields() int

func (*StructFieldList) Pos

func (f *StructFieldList) Pos() token.Pos

type StructInit

type StructInit struct {
	Init     token.Pos
	Body     []Stmt
	BlockEnd token.Pos
}

func (*StructInit) End

func (x *StructInit) End() token.Pos

func (*StructInit) Flatten

func (x *StructInit) Flatten() []Node

func (*StructInit) Pos

func (x *StructInit) Pos() token.Pos

type StructStmt

type StructStmt struct {
	Struct token.Pos
	Name   *Ident
	Fields *StructFieldList
	Init   *StructInit
}

func (*StructStmt) End

func (x *StructStmt) End() token.Pos

func (*StructStmt) Flatten

func (x *StructStmt) Flatten() []Node

func (*StructStmt) Pos

func (x *StructStmt) Pos() token.Pos

type SymbolExpr

type SymbolExpr struct {
	Module *Ident
	Symbol *Ident
}

type SymbolStmt

type SymbolStmt struct {
	Symbol token.Pos
	Ident  *Ident
}

func (*SymbolStmt) End

func (x *SymbolStmt) End() token.Pos

func (*SymbolStmt) Flatten

func (s *SymbolStmt) Flatten() []Node

func (*SymbolStmt) Pos

func (x *SymbolStmt) Pos() token.Pos

type ThrowExpr

type ThrowExpr struct {
	Throw token.Pos
	X     Expr
}

func (*ThrowExpr) End

func (s *ThrowExpr) End() token.Pos

func (*ThrowExpr) Flatten

func (s *ThrowExpr) Flatten() []Node

func (*ThrowExpr) Pos

func (s *ThrowExpr) Pos() token.Pos

type Token

type Token struct {
	Type   token.Token
	Source string
}

type TryStmt

type TryStmt struct {
	Try      token.Pos
	Body     []Stmt
	Catch    *CatchStmt
	Finally  *FinallyStmt
	BlockEnd token.Pos
}

func (*TryStmt) End

func (s *TryStmt) End() token.Pos

func (*TryStmt) Flatten

func (s *TryStmt) Flatten() []Node

func (*TryStmt) Pos

func (s *TryStmt) Pos() token.Pos

type UnaryExpr

type UnaryExpr struct {
	OpPos token.Pos
	Op    token.Token
	X     Expr
}

func (*UnaryExpr) End

func (x *UnaryExpr) End() token.Pos

func (*UnaryExpr) Flatten

func (x *UnaryExpr) Flatten() []Node

func (*UnaryExpr) Pos

func (x *UnaryExpr) Pos() token.Pos

type YieldStmt

type YieldStmt struct {
	Yield  token.Pos
	Result Expr
}

func (*YieldStmt) End

func (s *YieldStmt) End() token.Pos

func (*YieldStmt) Flatten

func (s *YieldStmt) Flatten() []Node

func (*YieldStmt) Pos

func (s *YieldStmt) Pos() token.Pos

Jump to

Keyboard shortcuts

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