// An AddStringExpr is a string concatenation Expr[0] + Exprs[1] + ... + Expr[len(Expr)-1].
type AddStringExpr struct {
miniExpr
- list Nodes
+ List_ Nodes
}
func NewAddStringExpr(pos src.XPos, list []Node) *AddStringExpr {
n := &AddStringExpr{}
n.pos = pos
n.op = OADDSTR
- n.list.Set(list)
+ n.List_.Set(list)
return n
}
-func (n *AddStringExpr) List() Nodes { return n.list }
-func (n *AddStringExpr) PtrList() *Nodes { return &n.list }
-func (n *AddStringExpr) SetList(x Nodes) { n.list = x }
+func (n *AddStringExpr) List() Nodes { return n.List_ }
+func (n *AddStringExpr) PtrList() *Nodes { return &n.List_ }
+func (n *AddStringExpr) SetList(x Nodes) { n.List_ = x }
// An AddrExpr is an address-of expression &X.
// It may end up being a normal address-of or an allocation of a composite literal.
X Node
Args Nodes
Rargs Nodes // TODO(rsc): Delete.
- body Nodes // TODO(rsc): Delete.
+ Body_ Nodes // TODO(rsc): Delete.
DDD bool
Use CallUse
noInline bool
func (n *CallExpr) SetIsDDD(x bool) { n.DDD = x }
func (n *CallExpr) NoInline() bool { return n.noInline }
func (n *CallExpr) SetNoInline(x bool) { n.noInline = x }
-func (n *CallExpr) Body() Nodes { return n.body }
-func (n *CallExpr) PtrBody() *Nodes { return &n.body }
-func (n *CallExpr) SetBody(x Nodes) { n.body = x }
+func (n *CallExpr) Body() Nodes { return n.Body_ }
+func (n *CallExpr) PtrBody() *Nodes { return &n.Body_ }
+func (n *CallExpr) SetBody(x Nodes) { n.Body_ = x }
func (n *CallExpr) SetOp(op Op) {
switch op {
// A ClosureExpr is a function literal expression.
type ClosureExpr struct {
miniExpr
- fn *Func
+ Func_ *Func
}
func NewClosureExpr(pos src.XPos, fn *Func) *ClosureExpr {
- n := &ClosureExpr{fn: fn}
+ n := &ClosureExpr{Func_: fn}
n.op = OCLOSURE
n.pos = pos
return n
}
-func (n *ClosureExpr) Func() *Func { return n.fn }
+func (n *ClosureExpr) Func() *Func { return n.Func_ }
// A ClosureRead denotes reading a variable stored within a closure struct.
type ClosureRead struct {
miniExpr
orig Node
Ntype Ntype
- list Nodes // initialized values
+ List_ Nodes // initialized values
}
func NewCompLitExpr(pos src.XPos, typ Ntype, list []Node) *CompLitExpr {
n := &CompLitExpr{Ntype: typ}
n.pos = pos
n.op = OCOMPLIT
- n.list.Set(list)
+ n.List_.Set(list)
n.orig = n
return n
}
func (n *CompLitExpr) SetOrig(x Node) { n.orig = x }
func (n *CompLitExpr) Right() Node { return n.Ntype }
func (n *CompLitExpr) SetRight(x Node) { n.Ntype = toNtype(x) }
-func (n *CompLitExpr) List() Nodes { return n.list }
-func (n *CompLitExpr) PtrList() *Nodes { return &n.list }
-func (n *CompLitExpr) SetList(x Nodes) { n.list = x }
+func (n *CompLitExpr) List() Nodes { return n.List_ }
+func (n *CompLitExpr) PtrList() *Nodes { return &n.List_ }
+func (n *CompLitExpr) SetList(x Nodes) { n.List_ = x }
func (n *CompLitExpr) SetOp(op Op) {
switch op {
// An InlinedCallExpr is an inlined function call.
type InlinedCallExpr struct {
miniExpr
- body Nodes
+ Body_ Nodes
ReturnVars Nodes
}
n := &InlinedCallExpr{}
n.pos = pos
n.op = OINLCALL
- n.body.Set(body)
+ n.Body_.Set(body)
n.ReturnVars.Set(retvars)
return n
}
-func (n *InlinedCallExpr) Body() Nodes { return n.body }
-func (n *InlinedCallExpr) PtrBody() *Nodes { return &n.body }
-func (n *InlinedCallExpr) SetBody(x Nodes) { n.body = x }
+func (n *InlinedCallExpr) Body() Nodes { return n.Body_ }
+func (n *InlinedCallExpr) PtrBody() *Nodes { return &n.Body_ }
+func (n *InlinedCallExpr) SetBody(x Nodes) { n.Body_ = x }
func (n *InlinedCallExpr) Rlist() Nodes { return n.ReturnVars }
func (n *InlinedCallExpr) PtrRlist() *Nodes { return &n.ReturnVars }
func (n *InlinedCallExpr) SetRlist(x Nodes) { n.ReturnVars = x }
// A SliceExpr is a slice expression X[Low:High] or X[Low:High:Max].
type SliceExpr struct {
miniExpr
- X Node
- list Nodes // TODO(rsc): Use separate Nodes
+ X Node
+ List_ Nodes // TODO(rsc): Use separate Nodes
}
func NewSliceExpr(pos src.XPos, op Op, x Node) *SliceExpr {
func (n *SliceExpr) Left() Node { return n.X }
func (n *SliceExpr) SetLeft(x Node) { n.X = x }
-func (n *SliceExpr) List() Nodes { return n.list }
-func (n *SliceExpr) PtrList() *Nodes { return &n.list }
-func (n *SliceExpr) SetList(x Nodes) { n.list = x }
+func (n *SliceExpr) List() Nodes { return n.List_ }
+func (n *SliceExpr) PtrList() *Nodes { return &n.List_ }
+func (n *SliceExpr) SetList(x Nodes) { n.List_ = x }
func (n *SliceExpr) SetOp(op Op) {
switch op {
// SliceBounds returns n's slice bounds: low, high, and max in expr[low:high:max].
// n must be a slice expression. max is nil if n is a simple slice expression.
func (n *SliceExpr) SliceBounds() (low, high, max Node) {
- if n.list.Len() == 0 {
+ if n.List_.Len() == 0 {
return nil, nil, nil
}
switch n.Op() {
case OSLICE, OSLICEARR, OSLICESTR:
- s := n.list.Slice()
+ s := n.List_.Slice()
return s[0], s[1], nil
case OSLICE3, OSLICE3ARR:
- s := n.list.Slice()
+ s := n.List_.Slice()
return s[0], s[1], s[2]
}
base.Fatalf("SliceBounds op %v: %v", n.Op(), n)
if max != nil {
base.Fatalf("SetSliceBounds %v given three bounds", n.Op())
}
- s := n.list.Slice()
+ s := n.List_.Slice()
if s == nil {
if low == nil && high == nil {
return
}
- n.list.Set2(low, high)
+ n.List_.Set2(low, high)
return
}
s[0] = low
s[1] = high
return
case OSLICE3, OSLICE3ARR:
- s := n.list.Slice()
+ s := n.List_.Slice()
if s == nil {
if low == nil && high == nil && max == nil {
return
}
- n.list.Set3(low, high, max)
+ n.List_.Set3(low, high, max)
return
}
s[0] = low
// A SliceHeader expression constructs a slice header from its parts.
type SliceHeaderExpr struct {
miniExpr
- Ptr Node
- lenCap Nodes // TODO(rsc): Split into two Node fields
+ Ptr Node
+ LenCap_ Nodes // TODO(rsc): Split into two Node fields
}
func NewSliceHeaderExpr(pos src.XPos, typ *types.Type, ptr, len, cap Node) *SliceHeaderExpr {
n.pos = pos
n.op = OSLICEHEADER
n.typ = typ
- n.lenCap.Set2(len, cap)
+ n.LenCap_.Set2(len, cap)
return n
}
func (n *SliceHeaderExpr) Left() Node { return n.Ptr }
func (n *SliceHeaderExpr) SetLeft(x Node) { n.Ptr = x }
-func (n *SliceHeaderExpr) List() Nodes { return n.lenCap }
-func (n *SliceHeaderExpr) PtrList() *Nodes { return &n.lenCap }
-func (n *SliceHeaderExpr) SetList(x Nodes) { n.lenCap = x }
+func (n *SliceHeaderExpr) List() Nodes { return n.LenCap_ }
+func (n *SliceHeaderExpr) PtrList() *Nodes { return &n.LenCap_ }
+func (n *SliceHeaderExpr) SetList(x Nodes) { n.LenCap_ = x }
// A StarExpr is a dereference expression *X.
// It may end up being a value or a type.
// pointer from the Func back to the OCALLPART.
type Func struct {
miniNode
- typ *types.Type
- body Nodes
- iota int64
+ typ *types.Type
+ Body_ Nodes
+ iota int64
Nname *Name // ONAME node
OClosure *ClosureExpr // OCLOSURE node
func (f *Func) isStmt() {}
func (f *Func) Func() *Func { return f }
-func (f *Func) Body() Nodes { return f.body }
-func (f *Func) PtrBody() *Nodes { return &f.body }
-func (f *Func) SetBody(x Nodes) { f.body = x }
+func (f *Func) Body() Nodes { return f.Body_ }
+func (f *Func) PtrBody() *Nodes { return &f.Body_ }
+func (f *Func) SetBody(x Nodes) { f.Body_ = x }
func (f *Func) Type() *types.Type { return f.typ }
func (f *Func) SetType(x *types.Type) { f.typ = x }
func (f *Func) Iota() int64 { return f.iota }
func (n *AddStringExpr) copy() Node {
c := *n
c.init = c.init.Copy()
- c.list = c.list.Copy()
+ c.List_ = c.List_.Copy()
return &c
}
func (n *AddStringExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
- err = maybeDoList(n.list, err, do)
+ err = maybeDoList(n.List_, err, do)
return err
}
func (n *AddStringExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
- editList(n.list, edit)
+ editList(n.List_, edit)
}
func (n *AddrExpr) String() string { return fmt.Sprint(n) }
func (n *BlockStmt) copy() Node {
c := *n
c.init = c.init.Copy()
- c.list = c.list.Copy()
+ c.List_ = c.List_.Copy()
return &c
}
func (n *BlockStmt) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
- err = maybeDoList(n.list, err, do)
+ err = maybeDoList(n.List_, err, do)
return err
}
func (n *BlockStmt) editChildren(edit func(Node) Node) {
editList(n.init, edit)
- editList(n.list, edit)
+ editList(n.List_, edit)
}
func (n *BranchStmt) String() string { return fmt.Sprint(n) }
c.init = c.init.Copy()
c.Args = c.Args.Copy()
c.Rargs = c.Rargs.Copy()
- c.body = c.body.Copy()
+ c.Body_ = c.Body_.Copy()
return &c
}
func (n *CallExpr) doChildren(do func(Node) error) error {
err = maybeDo(n.X, err, do)
err = maybeDoList(n.Args, err, do)
err = maybeDoList(n.Rargs, err, do)
- err = maybeDoList(n.body, err, do)
+ err = maybeDoList(n.Body_, err, do)
return err
}
func (n *CallExpr) editChildren(edit func(Node) Node) {
n.X = maybeEdit(n.X, edit)
editList(n.Args, edit)
editList(n.Rargs, edit)
- editList(n.body, edit)
+ editList(n.Body_, edit)
}
func (n *CallPartExpr) String() string { return fmt.Sprint(n) }
c := *n
c.init = c.init.Copy()
c.Vars = c.Vars.Copy()
- c.list = c.list.Copy()
- c.body = c.body.Copy()
+ c.List_ = c.List_.Copy()
+ c.Body_ = c.Body_.Copy()
return &c
}
func (n *CaseStmt) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDoList(n.Vars, err, do)
- err = maybeDoList(n.list, err, do)
+ err = maybeDoList(n.List_, err, do)
err = maybeDo(n.Comm, err, do)
- err = maybeDoList(n.body, err, do)
+ err = maybeDoList(n.Body_, err, do)
return err
}
func (n *CaseStmt) editChildren(edit func(Node) Node) {
editList(n.init, edit)
editList(n.Vars, edit)
- editList(n.list, edit)
+ editList(n.List_, edit)
n.Comm = maybeEdit(n.Comm, edit)
- editList(n.body, edit)
+ editList(n.Body_, edit)
}
func (n *ChanType) String() string { return fmt.Sprint(n) }
func (n *CompLitExpr) copy() Node {
c := *n
c.init = c.init.Copy()
- c.list = c.list.Copy()
+ c.List_ = c.List_.Copy()
return &c
}
func (n *CompLitExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.Ntype, err, do)
- err = maybeDoList(n.list, err, do)
+ err = maybeDoList(n.List_, err, do)
return err
}
func (n *CompLitExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.Ntype = toNtype(maybeEdit(n.Ntype, edit))
- editList(n.list, edit)
+ editList(n.List_, edit)
}
func (n *ConstExpr) String() string { return fmt.Sprint(n) }
c := *n
c.init = c.init.Copy()
c.Late = c.Late.Copy()
- c.body = c.body.Copy()
+ c.Body_ = c.Body_.Copy()
return &c
}
func (n *ForStmt) doChildren(do func(Node) error) error {
err = maybeDo(n.Cond, err, do)
err = maybeDoList(n.Late, err, do)
err = maybeDo(n.Post, err, do)
- err = maybeDoList(n.body, err, do)
+ err = maybeDoList(n.Body_, err, do)
return err
}
func (n *ForStmt) editChildren(edit func(Node) Node) {
n.Cond = maybeEdit(n.Cond, edit)
editList(n.Late, edit)
n.Post = maybeEdit(n.Post, edit)
- editList(n.body, edit)
+ editList(n.Body_, edit)
}
func (n *Func) String() string { return fmt.Sprint(n) }
func (n *Func) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *Func) copy() Node {
c := *n
- c.body = c.body.Copy()
+ c.Body_ = c.Body_.Copy()
return &c
}
func (n *Func) doChildren(do func(Node) error) error {
var err error
- err = maybeDoList(n.body, err, do)
+ err = maybeDoList(n.Body_, err, do)
return err
}
func (n *Func) editChildren(edit func(Node) Node) {
- editList(n.body, edit)
+ editList(n.Body_, edit)
}
func (n *FuncType) String() string { return fmt.Sprint(n) }
func (n *IfStmt) copy() Node {
c := *n
c.init = c.init.Copy()
- c.body = c.body.Copy()
+ c.Body_ = c.Body_.Copy()
c.Else = c.Else.Copy()
return &c
}
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.Cond, err, do)
- err = maybeDoList(n.body, err, do)
+ err = maybeDoList(n.Body_, err, do)
err = maybeDoList(n.Else, err, do)
return err
}
func (n *IfStmt) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.Cond = maybeEdit(n.Cond, edit)
- editList(n.body, edit)
+ editList(n.Body_, edit)
editList(n.Else, edit)
}
func (n *InlinedCallExpr) copy() Node {
c := *n
c.init = c.init.Copy()
- c.body = c.body.Copy()
+ c.Body_ = c.Body_.Copy()
c.ReturnVars = c.ReturnVars.Copy()
return &c
}
func (n *InlinedCallExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
- err = maybeDoList(n.body, err, do)
+ err = maybeDoList(n.Body_, err, do)
err = maybeDoList(n.ReturnVars, err, do)
return err
}
func (n *InlinedCallExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
- editList(n.body, edit)
+ editList(n.Body_, edit)
editList(n.ReturnVars, edit)
}
c := *n
c.init = c.init.Copy()
c.Vars = c.Vars.Copy()
- c.body = c.body.Copy()
+ c.Body_ = c.Body_.Copy()
return &c
}
func (n *RangeStmt) doChildren(do func(Node) error) error {
err = maybeDoList(n.init, err, do)
err = maybeDoList(n.Vars, err, do)
err = maybeDo(n.X, err, do)
- err = maybeDoList(n.body, err, do)
+ err = maybeDoList(n.Body_, err, do)
return err
}
func (n *RangeStmt) editChildren(edit func(Node) Node) {
editList(n.init, edit)
editList(n.Vars, edit)
n.X = maybeEdit(n.X, edit)
- editList(n.body, edit)
+ editList(n.Body_, edit)
}
func (n *ResultExpr) String() string { return fmt.Sprint(n) }
func (n *SliceExpr) copy() Node {
c := *n
c.init = c.init.Copy()
- c.list = c.list.Copy()
+ c.List_ = c.List_.Copy()
return &c
}
func (n *SliceExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.X, err, do)
- err = maybeDoList(n.list, err, do)
+ err = maybeDoList(n.List_, err, do)
return err
}
func (n *SliceExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.X = maybeEdit(n.X, edit)
- editList(n.list, edit)
+ editList(n.List_, edit)
}
func (n *SliceHeaderExpr) String() string { return fmt.Sprint(n) }
func (n *SliceHeaderExpr) copy() Node {
c := *n
c.init = c.init.Copy()
- c.lenCap = c.lenCap.Copy()
+ c.LenCap_ = c.LenCap_.Copy()
return &c
}
func (n *SliceHeaderExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.Ptr, err, do)
- err = maybeDoList(n.lenCap, err, do)
+ err = maybeDoList(n.LenCap_, err, do)
return err
}
func (n *SliceHeaderExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.Ptr = maybeEdit(n.Ptr, edit)
- editList(n.lenCap, edit)
+ editList(n.LenCap_, edit)
}
func (n *SliceType) String() string { return fmt.Sprint(n) }
}
func (n *TypeSwitchGuard) doChildren(do func(Node) error) error {
var err error
- if n.name != nil {
- err = maybeDo(n.name, err, do)
+ if n.Name_ != nil {
+ err = maybeDo(n.Name_, err, do)
}
err = maybeDo(n.X, err, do)
return err
}
func (n *TypeSwitchGuard) editChildren(edit func(Node) Node) {
- if n.name != nil {
- n.name = edit(n.name).(*Name)
+ if n.Name_ != nil {
+ n.Name_ = edit(n.Name_).(*Name)
}
n.X = maybeEdit(n.X, edit)
}
// A BlockStmt is a block: { List }.
type BlockStmt struct {
miniStmt
- list Nodes
+ List_ Nodes
}
func NewBlockStmt(pos src.XPos, list []Node) *BlockStmt {
n := &BlockStmt{}
n.pos = pos
n.op = OBLOCK
- n.list.Set(list)
+ n.List_.Set(list)
return n
}
-func (n *BlockStmt) List() Nodes { return n.list }
-func (n *BlockStmt) PtrList() *Nodes { return &n.list }
-func (n *BlockStmt) SetList(x Nodes) { n.list = x }
+func (n *BlockStmt) List() Nodes { return n.List_ }
+func (n *BlockStmt) PtrList() *Nodes { return &n.List_ }
+func (n *BlockStmt) SetList(x Nodes) { n.List_ = x }
// A BranchStmt is a break, continue, fallthrough, or goto statement.
//
// A CaseStmt is a case statement in a switch or select: case List: Body.
type CaseStmt struct {
miniStmt
- Vars Nodes // declared variable for this case in type switch
- list Nodes // list of expressions for switch, early select
- Comm Node // communication case (Exprs[0]) after select is type-checked
- body Nodes
+ Vars Nodes // declared variable for this case in type switch
+ List_ Nodes // list of expressions for switch, early select
+ Comm Node // communication case (Exprs[0]) after select is type-checked
+ Body_ Nodes
}
func NewCaseStmt(pos src.XPos, list, body []Node) *CaseStmt {
n := &CaseStmt{}
n.pos = pos
n.op = OCASE
- n.list.Set(list)
- n.body.Set(body)
+ n.List_.Set(list)
+ n.Body_.Set(body)
return n
}
-func (n *CaseStmt) List() Nodes { return n.list }
-func (n *CaseStmt) PtrList() *Nodes { return &n.list }
-func (n *CaseStmt) SetList(x Nodes) { n.list = x }
-func (n *CaseStmt) Body() Nodes { return n.body }
-func (n *CaseStmt) PtrBody() *Nodes { return &n.body }
-func (n *CaseStmt) SetBody(x Nodes) { n.body = x }
+func (n *CaseStmt) List() Nodes { return n.List_ }
+func (n *CaseStmt) PtrList() *Nodes { return &n.List_ }
+func (n *CaseStmt) SetList(x Nodes) { n.List_ = x }
+func (n *CaseStmt) Body() Nodes { return n.Body_ }
+func (n *CaseStmt) PtrBody() *Nodes { return &n.Body_ }
+func (n *CaseStmt) SetBody(x Nodes) { n.Body_ = x }
func (n *CaseStmt) Rlist() Nodes { return n.Vars }
func (n *CaseStmt) PtrRlist() *Nodes { return &n.Vars }
func (n *CaseStmt) SetRlist(x Nodes) { n.Vars = x }
Cond Node
Late Nodes
Post Node
- body Nodes
+ Body_ Nodes
hasBreak bool
}
n.pos = pos
n.op = OFOR
n.init.Set(init)
- n.body.Set(body)
+ n.Body_.Set(body)
return n
}
func (n *ForStmt) SetLeft(x Node) { n.Cond = x }
func (n *ForStmt) Right() Node { return n.Post }
func (n *ForStmt) SetRight(x Node) { n.Post = x }
-func (n *ForStmt) Body() Nodes { return n.body }
-func (n *ForStmt) PtrBody() *Nodes { return &n.body }
-func (n *ForStmt) SetBody(x Nodes) { n.body = x }
+func (n *ForStmt) Body() Nodes { return n.Body_ }
+func (n *ForStmt) PtrBody() *Nodes { return &n.Body_ }
+func (n *ForStmt) SetBody(x Nodes) { n.Body_ = x }
func (n *ForStmt) List() Nodes { return n.Late }
func (n *ForStmt) PtrList() *Nodes { return &n.Late }
func (n *ForStmt) SetList(x Nodes) { n.Late = x }
type IfStmt struct {
miniStmt
Cond Node
- body Nodes
+ Body_ Nodes
Else Nodes
likely bool // code layout hint
}
n := &IfStmt{Cond: cond}
n.pos = pos
n.op = OIF
- n.body.Set(body)
+ n.Body_.Set(body)
n.Else.Set(els)
return n
}
func (n *IfStmt) Left() Node { return n.Cond }
func (n *IfStmt) SetLeft(x Node) { n.Cond = x }
-func (n *IfStmt) Body() Nodes { return n.body }
-func (n *IfStmt) PtrBody() *Nodes { return &n.body }
-func (n *IfStmt) SetBody(x Nodes) { n.body = x }
+func (n *IfStmt) Body() Nodes { return n.Body_ }
+func (n *IfStmt) PtrBody() *Nodes { return &n.Body_ }
+func (n *IfStmt) SetBody(x Nodes) { n.Body_ = x }
func (n *IfStmt) Rlist() Nodes { return n.Else }
func (n *IfStmt) PtrRlist() *Nodes { return &n.Else }
func (n *IfStmt) SetRlist(x Nodes) { n.Else = x }
Vars Nodes // TODO(rsc): Replace with Key, Value Node
Def bool
X Node
- body Nodes
+ Body_ Nodes
hasBreak bool
typ *types.Type // TODO(rsc): Remove - use X.Type() instead
}
n.pos = pos
n.op = ORANGE
n.Vars.Set(vars)
- n.body.Set(body)
+ n.Body_.Set(body)
return n
}
func (n *RangeStmt) SetSym(x *types.Sym) { n.Label = x }
func (n *RangeStmt) Right() Node { return n.X }
func (n *RangeStmt) SetRight(x Node) { n.X = x }
-func (n *RangeStmt) Body() Nodes { return n.body }
-func (n *RangeStmt) PtrBody() *Nodes { return &n.body }
-func (n *RangeStmt) SetBody(x Nodes) { n.body = x }
+func (n *RangeStmt) Body() Nodes { return n.Body_ }
+func (n *RangeStmt) PtrBody() *Nodes { return &n.Body_ }
+func (n *RangeStmt) SetBody(x Nodes) { n.Body_ = x }
func (n *RangeStmt) List() Nodes { return n.Vars }
func (n *RangeStmt) PtrList() *Nodes { return &n.Vars }
func (n *RangeStmt) SetList(x Nodes) { n.Vars = x }
// A TypeSwitchGuard is the [Name :=] X.(type) in a type switch.
type TypeSwitchGuard struct {
miniNode
- name *Name
- X Node
+ Name_ *Name
+ X Node
}
func NewTypeSwitchGuard(pos src.XPos, name, x Node) *TypeSwitchGuard {
n := &TypeSwitchGuard{X: x}
if name != nil {
- n.name = name.(*Name)
+ n.Name_ = name.(*Name)
}
n.pos = pos
n.op = OTYPESW
}
func (n *TypeSwitchGuard) Left() Node {
- if n.name == nil {
+ if n.Name_ == nil {
return nil
}
- return n.name
+ return n.Name_
}
func (n *TypeSwitchGuard) SetLeft(x Node) {
if x == nil {
- n.name = nil
+ n.Name_ = nil
return
}
- n.name = x.(*Name)
+ n.Name_ = x.(*Name)
}
func (n *TypeSwitchGuard) Right() Node { return n.X }
func (n *TypeSwitchGuard) SetRight(x Node) { n.X = x }