ast

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Copyright 2025 The Hulo Authors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

PowerShell reference: https://learn.microsoft.com/en-us/powershell/scripting/lang-spec/chapter-01?view=powershell-7.5 And https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about?view=powershell-7.5

Copyright 2025 The Hulo Authors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Copyright 2025 The Hulo Authors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print added in v0.2.0

func Print(node Node)

func String added in v0.3.0

func String(node Node) string

func Walk added in v0.2.0

func Walk(v Visitor, node Node)

func Write added in v0.3.0

func Write(node Node, output io.Writer)

Types

type ArrayExpr added in v0.2.0

type ArrayExpr struct {
	At     token.Pos // position of '@'
	Lparen token.Pos // position of '('
	Elems  []Expr
	Rparen token.Pos // position of ')'
}

@(10, "blue", 12.54e3, 16.30D)

func (*ArrayExpr) End added in v0.2.0

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

func (*ArrayExpr) Pos added in v0.2.0

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

type AssignStmt

type AssignStmt struct {
	Lhs    Expr
	TokPos token.Pos // position of '=' or '+=', '-=', '*=', etc.
	Tok    token.Token
	Rhs    Expr
}

func (*AssignStmt) End added in v0.2.0

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

func (*AssignStmt) Pos added in v0.2.0

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

type Attribute

type Attribute struct {
	Lparen token.Pos // position of '['
	Name   *Ident
	Recv   []Expr
	Rparen token.Pos // position of ']'
}

func (*Attribute) End added in v0.2.0

func (d *Attribute) End() token.Pos

func (*Attribute) Pos added in v0.2.0

func (d *Attribute) Pos() token.Pos

type BinaryExpr

type BinaryExpr struct {
	X     Expr        // left operand
	OpPos token.Pos   // position of Op
	Op    token.Token // operator
	Y     Expr        // right operand
}

A BinaryExpr node represents a binary expression.

func (*BinaryExpr) End

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

func (*BinaryExpr) Pos

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

type BlockExpr

type BlockExpr struct {
	Lbrace token.Pos // position of '{'
	List   []Expr    // list of expressions in the block
	Rbrace token.Pos // position of '}'
}

A BlockExpr node represents a script block expression. e.g., { "Hello there" } or { param($x) $x * 2 }

func (*BlockExpr) End added in v0.2.0

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

func (*BlockExpr) Pos added in v0.2.0

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

type BlockStmt added in v0.3.0

type BlockStmt struct {
	List []Stmt
}

func (*BlockStmt) End added in v0.3.0

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

func (*BlockStmt) Pos added in v0.3.0

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

type BoolLit added in v0.2.0

type BoolLit struct {
	ValPos token.Pos
	Val    bool
}

func (*BoolLit) End added in v0.2.0

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

func (*BoolLit) Pos added in v0.2.0

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

type BreakStmt

type BreakStmt struct {
	Break token.Pos
}

func (*BreakStmt) End added in v0.2.0

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

func (*BreakStmt) Pos added in v0.2.0

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

type CallExpr

type CallExpr struct {
	Func Expr
	Recv []Expr
}

func (*CallExpr) End added in v0.2.0

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

func (*CallExpr) Pos added in v0.2.0

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

type CaseClause added in v0.2.0

type CaseClause struct {
	Cond Expr
	Body *BlockStmt
}

func (*CaseClause) End added in v0.2.0

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

func (*CaseClause) Pos added in v0.2.0

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

type CastExpr added in v0.2.0

type CastExpr struct {
	Lbrack token.Pos // position of '['
	Type   Expr
	Rbrack token.Pos // position of ']'
	X      Expr
}

func (*CastExpr) End added in v0.2.0

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

func (*CastExpr) Pos added in v0.2.0

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

type CatchClause added in v0.2.0

type CatchClause struct {
	Catch  token.Pos // position of 'catch'
	Lbrack token.Pos // position of '['
	Type   Expr
	Rbrack token.Pos // position of ']'
	Body   *BlockStmt
}

func (*CatchClause) End added in v0.2.0

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

func (*CatchClause) Pos added in v0.2.0

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

type ClassDecl added in v0.2.0

type ClassDecl struct {
	Class      token.Pos // position of class keyword
	Name       *Ident
	Ctors      []*ConstructorDecl
	Properties []*PropertyDecl
	Methods    []*MethodDecl
}

func (*ClassDecl) End added in v0.3.0

func (d *ClassDecl) End() token.Pos

func (*ClassDecl) Pos added in v0.3.0

func (d *ClassDecl) Pos() token.Pos

type CmdExpr added in v0.2.0

type CmdExpr struct {
	Cmd  Expr
	Args []Expr
}

func (*CmdExpr) End added in v0.2.0

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

func (*CmdExpr) Pos added in v0.2.0

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

type CommaExpr added in v0.2.0

type CommaExpr struct {
	Elems []Expr
}

10, "blue", 12.54e3, 16.30D

func (*CommaExpr) End added in v0.2.0

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

func (*CommaExpr) Pos added in v0.2.0

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

type Comment added in v0.2.0

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

type CommentGroup added in v0.2.0

type CommentGroup struct {
	List []Comment
}

func (*CommentGroup) End added in v0.2.0

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

func (*CommentGroup) Pos added in v0.2.0

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

type ConstructorDecl added in v0.3.0

type ConstructorDecl struct {
	Name   *Ident
	Lparen token.Pos
	Params []Expr
	Rparen token.Pos
	Body   *BlockStmt
}

func (*ConstructorDecl) End added in v0.3.0

func (d *ConstructorDecl) End() token.Pos

func (*ConstructorDecl) Pos added in v0.3.0

func (d *ConstructorDecl) Pos() token.Pos

type ContinueStmt

type ContinueStmt struct {
	Continue token.Pos // position of 'continue'
	Label    *Ident
}

continue [label]

func (*ContinueStmt) End added in v0.2.0

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

func (*ContinueStmt) Pos added in v0.2.0

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

type DataStmt

type DataStmt struct {
	Data token.Pos // position of 'data'
	Recv []Expr
	Body *BlockStmt
}

func (*DataStmt) End added in v0.2.0

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

func (*DataStmt) Pos added in v0.2.0

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

type DelimitedComment added in v0.2.0

type DelimitedComment struct {
	Opening token.Pos // position of '<#'
	Text    string
	Closing token.Pos // position of '#>'
}

<# <help-directive-1> <help-content-1> ...

<help-directive-n> <help-content-n> #>

func (*DelimitedComment) End added in v0.2.0

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

func (*DelimitedComment) Pos added in v0.2.0

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

type DoUntilStmt added in v0.2.0

type DoUntilStmt struct {
	Do     token.Pos // position of 'do'
	Body   *BlockStmt
	Until  token.Pos // position of 'until'
	Lparen token.Pos // position of '('
	Cond   Expr
	Rparen token.Pos // position of ')'
}

func (*DoUntilStmt) End added in v0.2.0

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

func (*DoUntilStmt) Pos added in v0.2.0

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

type DoWhileStmt added in v0.2.0

type DoWhileStmt struct {
	Do     token.Pos // position of 'do'
	Body   *BlockStmt
	While  token.Pos // position of 'while'
	Lparen token.Pos // position of '('
	Cond   Expr
	Rparen token.Pos // position of ')'
}

func (*DoWhileStmt) End added in v0.2.0

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

func (*DoWhileStmt) Pos added in v0.2.0

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

type DynamicparamStmt added in v0.2.0

type DynamicparamStmt struct {
	Dynamicparam token.Pos // position of 'dynamicparam'
	Body         *BlockStmt
}

func (*DynamicparamStmt) End added in v0.2.0

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

func (*DynamicparamStmt) Pos added in v0.2.0

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

type EnumDecl added in v0.2.0

type EnumDecl struct {
	Attrs          []*Attribute
	Enum           token.Pos // position of enum keyword
	Name           *Ident
	Colon          token.Pos // position of ':'
	UnderlyingType *Ident
	Lbrace         token.Pos // position of '{'
	List           []*EnumKeyValue
	Rbrace         token.Pos // position of '}'
}

func (*EnumDecl) End added in v0.3.0

func (d *EnumDecl) End() token.Pos

func (*EnumDecl) Pos added in v0.3.0

func (d *EnumDecl) Pos() token.Pos

type EnumKeyValue added in v0.3.0

type EnumKeyValue struct {
	Label  *Ident
	Assign token.Pos
	Value  Expr
}

func (*EnumKeyValue) End added in v0.3.0

func (d *EnumKeyValue) End() token.Pos

func (*EnumKeyValue) Pos added in v0.3.0

func (d *EnumKeyValue) Pos() token.Pos

type ExplictExpr

type ExplictExpr struct {
	X Expr
	Y Expr
}

type Expr

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

type ExprStmt

type ExprStmt struct {
	X Expr
}

func (*ExprStmt) End added in v0.2.0

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

func (*ExprStmt) Pos added in v0.2.0

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

type File

type File struct {
	Docs  []*CommentGroup
	Name  *Ident
	Stmts []Stmt
}

func (*File) End added in v0.2.0

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

func (*File) Pos added in v0.2.0

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

type ForStmt

type ForStmt struct {
	For   token.Pos // position of 'for'
	Init  Expr
	Semi  token.Pos // position of ';'
	Cond  Expr
	Semi2 token.Pos // position of ';'
	Post  Expr
	Body  *BlockStmt
}

func (*ForStmt) End added in v0.2.0

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

func (*ForStmt) Pos added in v0.2.0

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

type ForeachStmt

type ForeachStmt struct {
	Foreach token.Pos   // position of 'foreach'
	Opt     token.Token // TODO: -Parallel
	Lparen  token.Pos   // position of '('
	Elm     Expr
	In      token.Pos // position of 'in'
	Elms    Expr
	Rparen  token.Pos // position of ')'
	Body    *BlockStmt
}

func (*ForeachStmt) End added in v0.2.0

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

func (*ForeachStmt) Pos added in v0.2.0

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

type FuncDecl added in v0.2.0

type FuncDecl struct {
	Function token.Pos // position of function keyword
	Name     *Ident
	Body     *BlockStmt
}

func (*FuncDecl) End added in v0.2.0

func (d *FuncDecl) End() token.Pos

func (*FuncDecl) Pos added in v0.2.0

func (d *FuncDecl) Pos() token.Pos

type FuncStmt

type FuncStmt struct {
	Func Expr
	Recv []Expr
	Body *BlockStmt
}

type GroupExpr added in v0.2.0

type GroupExpr struct {
	Sep    token.Token
	Lparen token.Pos // position of '('
	Elems  []Expr
	Rparen token.Pos // position of ')'
}

func (*GroupExpr) End added in v0.2.0

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

func (*GroupExpr) Pos added in v0.2.0

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

type HashEntry added in v0.2.0

type HashEntry struct {
	Key    *Ident
	Assign token.Pos // position of '='
	Value  Expr
}

func (*HashEntry) End added in v0.2.0

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

func (*HashEntry) Pos added in v0.2.0

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

type HashTable

type HashTable struct {
	At      token.Pos // position of '@'
	Lbrace  token.Pos // position of '{'
	Entries []*HashEntry
	Rbrace  token.Pos // position of '}'
}

func (*HashTable) End added in v0.2.0

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

func (*HashTable) Pos added in v0.2.0

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

type HelpDirective added in v0.2.0

type HelpDirective interface {
	// contains filtered or unexported methods
}

TODO: add help directive https://learn.microsoft.com/en-us/powershell/scripting/lang-spec/chapter-14?view=powershell-7.5

type Ident

type Ident struct {
	NamePos token.Pos // identifier position
	Name    string    // identifier name
}

An Ident node represents an identifier.

func (*Ident) End

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

func (*Ident) Pos

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

type IfStmt

type IfStmt struct {
	If     token.Pos // position of 'if'
	LParen token.Pos // position of '('
	Cond   Expr
	RParen token.Pos // position of ')'
	Body   *BlockStmt
	Else   Stmt
}

func (*IfStmt) End added in v0.2.0

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

func (*IfStmt) Pos added in v0.2.0

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

type IncDecExpr

type IncDecExpr struct {
	Pre    bool
	X      Expr
	Tok    token.Token // Token.INC or Token.DEC
	TokPos token.Pos   // position of "++" or "--"
}

++$X --$X

func (*IncDecExpr) End

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

func (*IncDecExpr) Pos

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

type IndexExpr

type IndexExpr struct {
	X      Expr
	Lbrack token.Pos
	Index  Expr
	Rbrack token.Pos
}

func (*IndexExpr) End added in v0.2.0

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

func (*IndexExpr) Pos added in v0.2.0

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

type IndicesExpr added in v0.2.0

type IndicesExpr struct {
	X       Expr
	Lbrack  token.Pos // position of '['
	Indices []Expr
	Rbrack  token.Pos // position of ']'
}

func (*IndicesExpr) End added in v0.2.0

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

func (*IndicesExpr) Pos added in v0.2.0

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

type InlinescriptDecl added in v0.2.0

type InlinescriptDecl struct {
	Inlinescript token.Pos // position of inlinescript keyword
	Body         *BlockStmt
}

func (*InlinescriptDecl) End added in v0.2.0

func (d *InlinescriptDecl) End() token.Pos

func (*InlinescriptDecl) Pos added in v0.2.0

func (d *InlinescriptDecl) Pos() token.Pos

type LabelStmt

type LabelStmt struct {
	Colon token.Pos // position of ':'
	X     Expr
}

:label

func (*LabelStmt) End added in v0.2.0

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

func (*LabelStmt) Pos added in v0.2.0

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

type Lit added in v0.2.0

type Lit struct {
	Val    string
	ValPos token.Pos
}

func (*Lit) End added in v0.2.0

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

func (*Lit) Pos added in v0.2.0

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

type MemberAccess

type MemberAccess struct {
	Dollar token.Pos // position of '$'
	Long   bool
	Lbrace token.Pos // position of '{'
	X      Expr
	Colon  token.Pos // position of ':'
	Y      Expr
	Rbrace token.Pos // position of '}'
}

$X:Y or ${X:Y}

func (*MemberAccess) End added in v0.2.0

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

func (*MemberAccess) Pos added in v0.2.0

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

type MethodDecl added in v0.3.0

type MethodDecl struct {
	StaticPos token.Pos
	Static    bool
	Type      Expr
	Name      *Ident
	Lparen    token.Pos
	Params    []Expr
	Rparen    token.Pos
	Body      *BlockStmt
}

func (*MethodDecl) End added in v0.3.0

func (d *MethodDecl) End() token.Pos

func (*MethodDecl) Pos added in v0.3.0

func (d *MethodDecl) Pos() token.Pos

type Modifier added in v0.3.0

type Modifier int
const (
	ModNone   Modifier = iota //
	ModHidden                 // hidden
	ModStatic                 // static
)

func (Modifier) String added in v0.3.0

func (i Modifier) String() string

type MultiStringLit added in v0.2.0

type MultiStringLit struct {
	LAt    token.Pos // position of '@'
	LQuote token.Pos // position of '"'
	Val    string
	Rquote token.Pos // position of '"'
	RAt    token.Pos // position of '@'
}

@" ... "@

func (*MultiStringLit) End added in v0.2.0

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

func (*MultiStringLit) Pos added in v0.2.0

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

type Node

type Node interface {
	Pos() token.Pos
	End() token.Pos
}

type NumericLit added in v0.2.0

type NumericLit struct {
	ValPos token.Pos
	Val    string
}

func (*NumericLit) End added in v0.2.0

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

func (*NumericLit) Pos added in v0.2.0

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

type ParallelDecl added in v0.2.0

type ParallelDecl struct {
	Parallel token.Pos // position of parallel keyword
	Body     *BlockStmt
}

func (*ParallelDecl) End added in v0.2.0

func (d *ParallelDecl) End() token.Pos

func (*ParallelDecl) Pos added in v0.2.0

func (d *ParallelDecl) Pos() token.Pos

type ParamBlock added in v0.2.0

type ParamBlock struct {
	Attributes []*Attribute
	Param      token.Pos // position of 'param'
	Lparen     token.Pos // position of '('
	Params     []*Parameter
	Rparen     token.Pos // position of ')'
}

func (*ParamBlock) End added in v0.2.0

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

func (*ParamBlock) Pos added in v0.2.0

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

type Parameter added in v0.2.0

type Parameter struct {
	Attrs  []*Attribute
	X      Expr
	Assign token.Pos // position of '='
	Value  Expr
}

[attribute-1] [attribute-2] ... [type]$name

func (*Parameter) End added in v0.2.0

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

func (*Parameter) Pos added in v0.2.0

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

type ProcessDecl added in v0.2.0

type ProcessDecl struct {
	Process token.Pos // position of process keyword
	Body    *BlockStmt
}

func (*ProcessDecl) End added in v0.2.0

func (d *ProcessDecl) End() token.Pos

func (*ProcessDecl) Pos added in v0.2.0

func (d *ProcessDecl) Pos() token.Pos

type PropertyDecl added in v0.3.0

type PropertyDecl struct {
	ModPos token.Pos
	Mod    Modifier
	Type   Expr
	Dollar token.Pos
	Name   *Ident
	Assign token.Pos
	Value  Expr
}

func (*PropertyDecl) End added in v0.3.0

func (d *PropertyDecl) End() token.Pos

func (*PropertyDecl) Pos added in v0.3.0

func (d *PropertyDecl) Pos() token.Pos

type RangeExpr added in v0.2.0

type RangeExpr struct {
	X      Expr
	DblDot token.Pos // position of '..'
	Y      Expr
}

1..10

func (*RangeExpr) End added in v0.2.0

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

func (*RangeExpr) Pos added in v0.2.0

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

type RedirectExpr added in v0.2.0

type RedirectExpr struct {
	X     Expr
	CtrOp token.Token
	OpPos token.Pos
	Y     Expr
}

1>&2 or 1>>2

func (*RedirectExpr) End added in v0.2.0

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

func (*RedirectExpr) Pos added in v0.2.0

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

type ReturnStmt

type ReturnStmt struct {
	Return token.Pos // position of 'return'
	X      Expr
}

func (*ReturnStmt) End added in v0.3.0

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

func (*ReturnStmt) Pos added in v0.3.0

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

type SelectExpr added in v0.2.0

type SelectExpr struct {
	X   Expr
	Dot token.Pos // position of '.'
	Sel Expr
}

func (*SelectExpr) End added in v0.2.0

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

func (*SelectExpr) Pos added in v0.2.0

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

type SequenceDecl added in v0.2.0

type SequenceDecl struct {
	Sequence token.Pos // position of sequence keyword
	Body     *BlockStmt
}

func (*SequenceDecl) End added in v0.2.0

func (d *SequenceDecl) End() token.Pos

func (*SequenceDecl) Pos added in v0.2.0

func (d *SequenceDecl) Pos() token.Pos

type SingleLineComment added in v0.2.0

type SingleLineComment struct {
	Hash token.Pos
	Text string
}

<comment>

func (*SingleLineComment) End added in v0.2.0

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

func (*SingleLineComment) Pos added in v0.2.0

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

type StaticMemberAccess added in v0.2.0

type StaticMemberAccess struct {
	X        Expr
	DblColon token.Pos // position of '::'
	Y        Expr
}

X::Y

func (*StaticMemberAccess) End added in v0.2.0

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

func (*StaticMemberAccess) Pos added in v0.2.0

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

type Stmt

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

type StringLit added in v0.2.0

type StringLit struct {
	ValPos token.Pos
	Val    string
}

func (*StringLit) End added in v0.2.0

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

func (*StringLit) Pos added in v0.2.0

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

type SubExpr

type SubExpr struct {
	Dollar token.Pos // position of '$'
	Lparen token.Pos // position of '('
	X      Expr
	Rparen token.Pos // position of ')'
}

$( ... )

func (*SubExpr) End added in v0.2.0

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

func (*SubExpr) Pos added in v0.2.0

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

type SwitchPattern

type SwitchPattern int
const (
	SwitchPatternNone SwitchPattern = iota
	SwitchPatternRegex
	SwitchPatternWildcard
	SwitchPatternExact
)

func (SwitchPattern) String

func (p SwitchPattern) String() string

type SwitchStmt

type SwitchStmt struct {
	Switch        token.Pos // position of 'switch'
	Pattern       SwitchPattern
	Casesensitive bool
	Lparen        token.Pos // position of '('
	Value         Expr
	Rparen        token.Pos // position of ')'
	Lbrace        token.Pos // position of '{'
	Cases         []*CaseClause
	Default       *BlockStmt
	Rbrace        token.Pos // position of '}'
}

func (*SwitchStmt) End added in v0.2.0

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

func (*SwitchStmt) Pos added in v0.2.0

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

type ThrowStmt

type ThrowStmt struct {
	Throw token.Pos // position of 'throw'
	X     Expr
}

func (*ThrowStmt) End added in v0.2.0

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

func (*ThrowStmt) Pos added in v0.2.0

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

type TrapStmt added in v0.2.0

type TrapStmt struct {
	Trap token.Pos // position of 'trap'
	Body *BlockStmt
}

func (*TrapStmt) End added in v0.2.0

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

func (*TrapStmt) Pos added in v0.2.0

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

type TryStmt

type TryStmt struct {
	Try         token.Pos // position of 'try'
	Body        *BlockStmt
	Catches     []*CatchClause
	Finally     token.Pos // position of 'finally'
	FinallyBody *BlockStmt
}

func (*TryStmt) End added in v0.2.0

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

func (*TryStmt) Pos added in v0.2.0

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

type TypeLit added in v0.2.0

type TypeLit struct {
	Lbrack token.Pos // position of '['
	Name   Expr
	Rbrack token.Pos // position of ']'
}

func (*TypeLit) End added in v0.2.0

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

func (*TypeLit) Pos added in v0.2.0

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

type UsingAssembly

type UsingAssembly struct {
	Assembly token.Pos
	Path     string
}

type UsingDecl

type UsingDecl struct {
	Using token.Pos
	*UsingModule
	*UsingNamespace
	*UsingAssembly
}

type UsingModule

type UsingModule struct {
	Module token.Pos
	Name   *Ident
}

type UsingNamespace

type UsingNamespace struct {
	Namespace token.Pos
	Name      *Ident
}

type VarExpr

type VarExpr struct {
	Dollar token.Pos // position of '$'
	X      Expr
}

func (*VarExpr) End added in v0.2.0

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

func (*VarExpr) Pos added in v0.2.0

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

type Visitor added in v0.2.0

type Visitor interface {
	Visit(node Node) (w Visitor)
}

A Visitor's Visit method is invoked for each node encountered by Walk. If the result visitor w is not nil, Walk visits each of the children of node with the visitor w, followed by a call of w.Visit(nil).

type WhileStmt

type WhileStmt struct {
	While  token.Pos // position of 'while'
	Lparen token.Pos // position of '('
	Cond   Expr
	Rparen token.Pos // position of ')'
	Body   *BlockStmt
}

func (*WhileStmt) End added in v0.2.0

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

func (*WhileStmt) Pos added in v0.2.0

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

type WorkflowDecl added in v0.2.0

type WorkflowDecl struct {
	Workflow token.Pos // position of workflow keyword
	Name     *Ident
	Body     *BlockStmt
}

func (*WorkflowDecl) End added in v0.2.0

func (d *WorkflowDecl) End() token.Pos

func (*WorkflowDecl) Pos added in v0.2.0

func (d *WorkflowDecl) Pos() token.Pos

Jump to

Keyboard shortcuts

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