remove name field

This commit is contained in:
z7zmey 2018-01-04 20:29:07 +02:00
parent e8655c5f4c
commit 383a245370
159 changed files with 14 additions and 891 deletions

View File

@ -2,6 +2,7 @@ package main
import (
"fmt"
"reflect"
"github.com/z7zmey/php-parser/node"
)
@ -12,7 +13,7 @@ type dumper struct {
func (d dumper) EnterNode(n node.Node) bool {
fmt.Printf("%v%v", d.indent, n.Name())
fmt.Printf("%v%v", d.indent, reflect.TypeOf(n))
if p := n.Position(); p != nil {
fmt.Printf(" %v", *p)
}

View File

@ -1,7 +1,6 @@
package node
type Argument struct {
name string
attributes map[string]interface{}
position *Position
expr Node
@ -10,7 +9,6 @@ type Argument struct {
func NewArgument(expression Node, variadic bool) Node {
return Argument{
"Argument",
map[string]interface{}{
"variadic": variadic,
},
@ -20,10 +18,6 @@ func NewArgument(expression Node, variadic bool) Node {
}
}
func (n Argument) Name() string {
return "Argument"
}
func (n Argument) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type Array struct {
name string
attributes map[string]interface{}
position *node.Position
items []node.Node
@ -13,17 +12,12 @@ type Array struct {
func NewArray(items []node.Node) node.Node {
return Array{
"Array",
map[string]interface{}{},
nil,
items,
}
}
func (n Array) Name() string {
return "Array"
}
func (n Array) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type ArrayDimFetch struct {
name string
attributes map[string]interface{}
position *node.Position
variable node.Node
@ -14,7 +13,6 @@ type ArrayDimFetch struct {
func NewArrayDimFetch(variable node.Node, dim node.Node) node.Node {
return ArrayDimFetch{
"ArrayDimFetch",
map[string]interface{}{},
nil,
variable,
@ -22,10 +20,6 @@ func NewArrayDimFetch(variable node.Node, dim node.Node) node.Node {
}
}
func (n ArrayDimFetch) Name() string {
return "ArrayDimFetch"
}
func (n ArrayDimFetch) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type ArrayItem struct {
name string
attributes map[string]interface{}
position *node.Position
key node.Node
@ -14,7 +13,6 @@ type ArrayItem struct {
func NewArrayItem(key node.Node, val node.Node, byRef bool) node.Node {
return ArrayItem{
"ArrayItem",
map[string]interface{}{
"byRef": byRef,
},
@ -24,10 +22,6 @@ func NewArrayItem(key node.Node, val node.Node, byRef bool) node.Node {
}
}
func (n ArrayItem) Name() string {
return "ArrayItem"
}
func (n ArrayItem) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type Assign struct {
func NewAssign(variable node.Node, expression node.Node) node.Node {
return Assign{
AssignOp{
"Assign",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewAssign(variable node.Node, expression node.Node) node.Node {
}
}
func (n Assign) Name() string {
return "Assign"
}
func (n Assign) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type AssignOp struct {
name string
attributes map[string]interface{}
position *node.Position
variable node.Node

View File

@ -11,7 +11,6 @@ type AssignRef struct {
func NewAssignRef(variable node.Node, expression node.Node) node.Node {
return AssignRef{
AssignOp{
"AssignRef",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewAssignRef(variable node.Node, expression node.Node) node.Node {
}
}
func (n AssignRef) Name() string {
return "AssignRef"
}
func (n AssignRef) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type BitwiseAnd struct {
func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node {
return BitwiseAnd{
AssignOp{
"AssignBitwiseAnd",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node {
}
}
func (n BitwiseAnd) Name() string {
return "BitwiseAnd"
}
func (n BitwiseAnd) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type BitwiseOr struct {
func NewBitwiseOr(variable node.Node, expression node.Node) node.Node {
return BitwiseOr{
AssignOp{
"AssignBitwiseOr",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewBitwiseOr(variable node.Node, expression node.Node) node.Node {
}
}
func (n BitwiseOr) Name() string {
return "BitwiseOr"
}
func (n BitwiseOr) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type BitwiseXor struct {
func NewBitwiseXor(variable node.Node, expression node.Node) node.Node {
return BitwiseXor{
AssignOp{
"AssignBitwiseXor",
map[string]interface{}{},
nil,
variable,
@ -42,10 +41,6 @@ func (n BitwiseXor) SetPosition(p *node.Position) node.Node {
return n
}
func (n BitwiseXor) Name() string {
return "BitwiseXor"
}
func (n BitwiseXor) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@ -11,7 +11,6 @@ type Concat struct {
func NewConcat(variable node.Node, expression node.Node) node.Node {
return Concat{
AssignOp{
"AssignConcat",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewConcat(variable node.Node, expression node.Node) node.Node {
}
}
func (n Concat) Name() string {
return "Concat"
}
func (n Concat) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type Div struct {
func NewDiv(variable node.Node, expression node.Node) node.Node {
return Div{
AssignOp{
"AssignDiv",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewDiv(variable node.Node, expression node.Node) node.Node {
}
}
func (n Div) Name() string {
return "Div"
}
func (n Div) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type Minus struct {
func NewMinus(variable node.Node, expression node.Node) node.Node {
return Minus{
AssignOp{
"AssignMinus",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewMinus(variable node.Node, expression node.Node) node.Node {
}
}
func (n Minus) Name() string {
return "Minus"
}
func (n Minus) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type Mod struct {
func NewMod(variable node.Node, expression node.Node) node.Node {
return Mod{
AssignOp{
"AssignMod",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewMod(variable node.Node, expression node.Node) node.Node {
}
}
func (n Mod) Name() string {
return "Mod"
}
func (n Mod) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type Mul struct {
func NewMul(variable node.Node, expression node.Node) node.Node {
return Mul{
AssignOp{
"AssignMul",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewMul(variable node.Node, expression node.Node) node.Node {
}
}
func (n Mul) Name() string {
return "Mul"
}
func (n Mul) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type Plus struct {
func NewPlus(variable node.Node, expression node.Node) node.Node {
return Plus{
AssignOp{
"AssignPlus",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewPlus(variable node.Node, expression node.Node) node.Node {
}
}
func (n Plus) Name() string {
return "Plus"
}
func (n Plus) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type Pow struct {
func NewPow(variable node.Node, expression node.Node) node.Node {
return Pow{
AssignOp{
"AssignPow",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewPow(variable node.Node, expression node.Node) node.Node {
}
}
func (n Pow) Name() string {
return "Pow"
}
func (n Pow) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type ShiftLeft struct {
func NewShiftLeft(variable node.Node, expression node.Node) node.Node {
return ShiftLeft{
AssignOp{
"AssignShiftLeft",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewShiftLeft(variable node.Node, expression node.Node) node.Node {
}
}
func (n ShiftLeft) Name() string {
return "ShiftLeft"
}
func (n ShiftLeft) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type ShiftRight struct {
func NewShiftRight(variable node.Node, expression node.Node) node.Node {
return ShiftRight{
AssignOp{
"AssignShiftRight",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewShiftRight(variable node.Node, expression node.Node) node.Node {
}
}
func (n ShiftRight) Name() string {
return "ShiftRight"
}
func (n ShiftRight) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type BinaryOp struct {
name string
attributes map[string]interface{}
position *node.Position
left node.Node

View File

@ -11,7 +11,6 @@ type BitwiseAnd struct {
func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node {
return BitwiseAnd{
BinaryOp{
"BinaryBitwiseAnd",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node {
}
}
func (n BitwiseAnd) Name() string {
return "BitwiseAnd"
}
func (n BitwiseAnd) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type BitwiseOr struct {
func NewBitwiseOr(variable node.Node, expression node.Node) node.Node {
return BitwiseOr{
BinaryOp{
"BinaryBitwiseOr",
map[string]interface{}{},
nil,
variable,
@ -42,10 +41,6 @@ func (n BitwiseOr) SetPosition(p *node.Position) node.Node {
return n
}
func (n BitwiseOr) Name() string {
return "BitwiseOr"
}
func (n BitwiseOr) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@ -11,7 +11,6 @@ type BitwiseXor struct {
func NewBitwiseXor(variable node.Node, expression node.Node) node.Node {
return BitwiseXor{
BinaryOp{
"BinaryBitwiseXor",
map[string]interface{}{},
nil,
variable,
@ -42,10 +41,6 @@ func (n BitwiseXor) SetPosition(p *node.Position) node.Node {
return n
}
func (n BitwiseXor) Name() string {
return "BitwiseXor"
}
func (n BitwiseXor) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@ -11,7 +11,6 @@ type BooleanAnd struct {
func NewBooleanAnd(variable node.Node, expression node.Node) node.Node {
return BooleanAnd{
BinaryOp{
"BinaryBooleanAnd",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewBooleanAnd(variable node.Node, expression node.Node) node.Node {
}
}
func (n BooleanAnd) Name() string {
return "BooleanAnd"
}
func (n BooleanAnd) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type BooleanOr struct {
func NewBooleanOr(variable node.Node, expression node.Node) node.Node {
return BooleanOr{
BinaryOp{
"BinaryBooleanOr",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewBooleanOr(variable node.Node, expression node.Node) node.Node {
}
}
func (n BooleanOr) Name() string {
return "BooleanOr"
}
func (n BooleanOr) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type Coalesce struct {
func NewCoalesce(variable node.Node, expression node.Node) node.Node {
return Coalesce{
BinaryOp{
"BinaryCoalesce",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewCoalesce(variable node.Node, expression node.Node) node.Node {
}
}
func (n Coalesce) Name() string {
return "Coalesce"
}
func (n Coalesce) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type Concat struct {
func NewConcat(variable node.Node, expression node.Node) node.Node {
return Concat{
BinaryOp{
"BinaryConcat",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewConcat(variable node.Node, expression node.Node) node.Node {
}
}
func (n Concat) Name() string {
return "Concat"
}
func (n Concat) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type Div struct {
func NewDiv(variable node.Node, expression node.Node) node.Node {
return Div{
BinaryOp{
"BinaryDiv",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewDiv(variable node.Node, expression node.Node) node.Node {
}
}
func (n Div) Name() string {
return "Div"
}
func (n Div) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type Equal struct {
func NewEqual(variable node.Node, expression node.Node) node.Node {
return Equal{
BinaryOp{
"BinaryEqual",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewEqual(variable node.Node, expression node.Node) node.Node {
}
}
func (n Equal) Name() string {
return "Equal"
}
func (n Equal) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type Greater struct {
func NewGreater(variable node.Node, expression node.Node) node.Node {
return Greater{
BinaryOp{
"BinaryGreater",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewGreater(variable node.Node, expression node.Node) node.Node {
}
}
func (n Greater) Name() string {
return "Greater"
}
func (n Greater) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type GreaterOrEqual struct {
func NewGreaterOrEqual(variable node.Node, expression node.Node) node.Node {
return GreaterOrEqual{
BinaryOp{
"BinaryGreaterOrEqual",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewGreaterOrEqual(variable node.Node, expression node.Node) node.Node {
}
}
func (n GreaterOrEqual) Name() string {
return "GreaterOrEqual"
}
func (n GreaterOrEqual) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type Identical struct {
func NewIdentical(variable node.Node, expression node.Node) node.Node {
return Identical{
BinaryOp{
"BinaryIdentical",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewIdentical(variable node.Node, expression node.Node) node.Node {
}
}
func (n Identical) Name() string {
return "Identical"
}
func (n Identical) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type LogicalAnd struct {
func NewLogicalAnd(variable node.Node, expression node.Node) node.Node {
return LogicalAnd{
BinaryOp{
"BinaryLogicalAnd",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewLogicalAnd(variable node.Node, expression node.Node) node.Node {
}
}
func (n LogicalAnd) Name() string {
return "LogicalAnd"
}
func (n LogicalAnd) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type LogicalOr struct {
func NewLogicalOr(variable node.Node, expression node.Node) node.Node {
return LogicalOr{
BinaryOp{
"BinaryLogicalOr",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewLogicalOr(variable node.Node, expression node.Node) node.Node {
}
}
func (n LogicalOr) Name() string {
return "LogicalOr"
}
func (n LogicalOr) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type LogicalXor struct {
func NewLogicalXor(variable node.Node, expression node.Node) node.Node {
return LogicalXor{
BinaryOp{
"BinaryLogicalXor",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewLogicalXor(variable node.Node, expression node.Node) node.Node {
}
}
func (n LogicalXor) Name() string {
return "LogicalXor"
}
func (n LogicalXor) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type Minus struct {
func NewMinus(variable node.Node, expression node.Node) node.Node {
return Minus{
BinaryOp{
"BinaryMinus",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewMinus(variable node.Node, expression node.Node) node.Node {
}
}
func (n Minus) Name() string {
return "Minus"
}
func (n Minus) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type Mod struct {
func NewMod(variable node.Node, expression node.Node) node.Node {
return Mod{
BinaryOp{
"BinaryMod",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewMod(variable node.Node, expression node.Node) node.Node {
}
}
func (n Mod) Name() string {
return "Mod"
}
func (n Mod) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type Mul struct {
func NewMul(variable node.Node, expression node.Node) node.Node {
return Mul{
BinaryOp{
"BinaryMul",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewMul(variable node.Node, expression node.Node) node.Node {
}
}
func (n Mul) Name() string {
return "Mul"
}
func (n Mul) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type NotEqual struct {
func NewNotEqual(variable node.Node, expression node.Node) node.Node {
return NotEqual{
BinaryOp{
"BinaryNotEqual",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewNotEqual(variable node.Node, expression node.Node) node.Node {
}
}
func (n NotEqual) Name() string {
return "NotEqual"
}
func (n NotEqual) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type NotIdentical struct {
func NewNotIdentical(variable node.Node, expression node.Node) node.Node {
return NotIdentical{
BinaryOp{
"BinaryNotIdentical",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewNotIdentical(variable node.Node, expression node.Node) node.Node {
}
}
func (n NotIdentical) Name() string {
return "NotIdentical"
}
func (n NotIdentical) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type Plus struct {
func NewPlus(variable node.Node, expression node.Node) node.Node {
return Plus{
BinaryOp{
"BinaryPlus",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewPlus(variable node.Node, expression node.Node) node.Node {
}
}
func (n Plus) Name() string {
return "Plus"
}
func (n Plus) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type Pow struct {
func NewPow(variable node.Node, expression node.Node) node.Node {
return Pow{
BinaryOp{
"BinaryPow",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewPow(variable node.Node, expression node.Node) node.Node {
}
}
func (n Pow) Name() string {
return "Pow"
}
func (n Pow) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type ShiftLeft struct {
func NewShiftLeft(variable node.Node, expression node.Node) node.Node {
return ShiftLeft{
BinaryOp{
"BinaryShiftLeft",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewShiftLeft(variable node.Node, expression node.Node) node.Node {
}
}
func (n ShiftLeft) Name() string {
return "ShiftLeft"
}
func (n ShiftLeft) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type ShiftRight struct {
func NewShiftRight(variable node.Node, expression node.Node) node.Node {
return ShiftRight{
BinaryOp{
"BinaryShiftRight",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewShiftRight(variable node.Node, expression node.Node) node.Node {
}
}
func (n ShiftRight) Name() string {
return "ShiftRight"
}
func (n ShiftRight) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type Smaller struct {
func NewSmaller(variable node.Node, expression node.Node) node.Node {
return Smaller{
BinaryOp{
"BinarySmaller",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewSmaller(variable node.Node, expression node.Node) node.Node {
}
}
func (n Smaller) Name() string {
return "Smaller"
}
func (n Smaller) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type SmallerOrEqual struct {
func NewSmallerOrEqual(variable node.Node, expression node.Node) node.Node {
return SmallerOrEqual{
BinaryOp{
"BinarySmallerOrEqual",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewSmallerOrEqual(variable node.Node, expression node.Node) node.Node {
}
}
func (n SmallerOrEqual) Name() string {
return "SmallerOrEqual"
}
func (n SmallerOrEqual) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type Spaceship struct {
func NewSpaceship(variable node.Node, expression node.Node) node.Node {
return Spaceship{
BinaryOp{
"BinarySpaceship",
map[string]interface{}{},
nil,
variable,
@ -20,10 +19,6 @@ func NewSpaceship(variable node.Node, expression node.Node) node.Node {
}
}
func (n Spaceship) Name() string {
return "Spaceship"
}
func (n Spaceship) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type BitwiseNot struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
@ -13,17 +12,12 @@ type BitwiseNot struct {
func NewBitwiseNot(expression node.Node) node.Node {
return BitwiseNot{
"BitwiseNot",
map[string]interface{}{},
nil,
expression,
}
}
func (n BitwiseNot) Name() string {
return "BitwiseNot"
}
func (n BitwiseNot) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type BooleanNot struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
@ -13,17 +12,12 @@ type BooleanNot struct {
func NewBooleanNot(expression node.Node) node.Node {
return BooleanNot{
"BooleanNot",
map[string]interface{}{},
nil,
expression,
}
}
func (n BooleanNot) Name() string {
return "BooleanNot"
}
func (n BooleanNot) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type Cast struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node

View File

@ -11,7 +11,6 @@ type CastArray struct {
func NewCastArray(expr node.Node) node.Node {
return CastArray{
Cast{
"CastArray",
map[string]interface{}{},
nil,
expr,
@ -19,10 +18,6 @@ func NewCastArray(expr node.Node) node.Node {
}
}
func (n CastArray) Name() string {
return "CastArray"
}
func (n CastArray) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type CastBool struct {
func NewCastBool(expr node.Node) node.Node {
return CastBool{
Cast{
"CastBool",
map[string]interface{}{},
nil,
expr,
@ -19,10 +18,6 @@ func NewCastBool(expr node.Node) node.Node {
}
}
func (n CastBool) Name() string {
return "CastBool"
}
func (n CastBool) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type CastDouble struct {
func NewCastDouble(expr node.Node) node.Node {
return CastDouble{
Cast{
"CastDouble",
map[string]interface{}{},
nil,
expr,
@ -19,10 +18,6 @@ func NewCastDouble(expr node.Node) node.Node {
}
}
func (n CastDouble) Name() string {
return "CastDouble"
}
func (n CastDouble) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type CastInt struct {
func NewCastInt(expr node.Node) node.Node {
return CastInt{
Cast{
"CastInt",
map[string]interface{}{},
nil,
expr,
@ -19,10 +18,6 @@ func NewCastInt(expr node.Node) node.Node {
}
}
func (n CastInt) Name() string {
return "CastInt"
}
func (n CastInt) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type CastObject struct {
func NewCastObject(expr node.Node) node.Node {
return CastObject{
Cast{
"CastObject",
map[string]interface{}{},
nil,
expr,
@ -19,10 +18,6 @@ func NewCastObject(expr node.Node) node.Node {
}
}
func (n CastObject) Name() string {
return "CastObject"
}
func (n CastObject) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type CastString struct {
func NewCastString(expr node.Node) node.Node {
return CastString{
Cast{
"CastString",
map[string]interface{}{},
nil,
expr,
@ -19,10 +18,6 @@ func NewCastString(expr node.Node) node.Node {
}
}
func (n CastString) Name() string {
return "CastString"
}
func (n CastString) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -11,7 +11,6 @@ type CastUnset struct {
func NewCastUnset(expr node.Node) node.Node {
return CastUnset{
Cast{
"CastUnset",
map[string]interface{}{},
nil,
expr,
@ -19,10 +18,6 @@ func NewCastUnset(expr node.Node) node.Node {
}
}
func (n CastUnset) Name() string {
return "CastUnset"
}
func (n CastUnset) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type ClassConstFetch struct {
name string
attributes map[string]interface{}
position *node.Position
class node.Node
@ -14,7 +13,6 @@ type ClassConstFetch struct {
func NewClassConstFetch(class node.Node, constantName node.Node) node.Node {
return ClassConstFetch{
"ClassConstFetch",
map[string]interface{}{},
nil,
class,
@ -22,10 +20,6 @@ func NewClassConstFetch(class node.Node, constantName node.Node) node.Node {
}
}
func (n ClassConstFetch) Name() string {
return "ClassConstFetch"
}
func (n ClassConstFetch) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type Clone struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
@ -13,17 +12,12 @@ type Clone struct {
func NewClone(expression node.Node) node.Node {
return Clone{
"Clone",
map[string]interface{}{},
nil,
expression,
}
}
func (n Clone) Name() string {
return "Clone"
}
func (n Clone) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type Closure struct {
name string
attributes map[string]interface{}
position *node.Position
params []node.Node
@ -16,7 +15,6 @@ type Closure struct {
func NewClosure(params []node.Node, uses []node.Node, returnType node.Node, stmts []node.Node, isStatic bool, isReturnRef bool, phpDocComment string) node.Node {
return Closure{
"Closure",
map[string]interface{}{
"isReturnRef": isReturnRef,
"isStatic": isStatic,
@ -30,10 +28,6 @@ func NewClosure(params []node.Node, uses []node.Node, returnType node.Node, stmt
}
}
func (n Closure) Name() string {
return "Closure"
}
func (n Closure) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type ClusureUse struct {
name string
attributes map[string]interface{}
position *node.Position
variable node.Node
@ -13,7 +12,6 @@ type ClusureUse struct {
func NewClusureUse(variable node.Node, byRef bool) node.Node {
return ClusureUse{
"ClusureUse",
map[string]interface{}{
"byRef": byRef,
},
@ -22,10 +20,6 @@ func NewClusureUse(variable node.Node, byRef bool) node.Node {
}
}
func (n ClusureUse) Name() string {
return "ClusureUse"
}
func (n ClusureUse) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type ConstFetch struct {
name string
attributes map[string]interface{}
position *node.Position
constant node.Node
@ -13,17 +12,12 @@ type ConstFetch struct {
func NewConstFetch(constant node.Node) node.Node {
return ConstFetch{
"ConstFetch",
map[string]interface{}{},
nil,
constant,
}
}
func (n ConstFetch) Name() string {
return "ConstFetch"
}
func (n ConstFetch) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type Empty struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
@ -13,17 +12,12 @@ type Empty struct {
func NewEmpty(expression node.Node) node.Node {
return Empty{
"Empty",
map[string]interface{}{},
nil,
expression,
}
}
func (n Empty) Name() string {
return "Empty"
}
func (n Empty) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type ErrorSuppress struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
@ -13,17 +12,12 @@ type ErrorSuppress struct {
func NewErrorSuppress(expression node.Node) node.Node {
return ErrorSuppress{
"ErrorSuppress",
map[string]interface{}{},
nil,
expression,
}
}
func (n ErrorSuppress) Name() string {
return "ErrorSuppress"
}
func (n ErrorSuppress) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type Eval struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
@ -13,17 +12,12 @@ type Eval struct {
func NewEval(expression node.Node) node.Node {
return Eval{
"Eval",
map[string]interface{}{},
nil,
expression,
}
}
func (n Eval) Name() string {
return "Eval"
}
func (n Eval) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type Exit struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
@ -13,7 +12,6 @@ type Exit struct {
func NewExit(expr node.Node, isDie bool) node.Node {
return Exit{
"Exit",
map[string]interface{}{
"isDie": isDie,
},
@ -22,10 +20,6 @@ func NewExit(expr node.Node, isDie bool) node.Node {
}
}
func (n Exit) Name() string {
return "Exit"
}
func (n Exit) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type FunctionCall struct {
name string
attributes map[string]interface{}
position *node.Position
function node.Node
@ -14,7 +13,6 @@ type FunctionCall struct {
func NewFunctionCall(function node.Node, arguments []node.Node) node.Node {
return FunctionCall{
"FunctionCall",
map[string]interface{}{},
nil,
function,
@ -22,10 +20,6 @@ func NewFunctionCall(function node.Node, arguments []node.Node) node.Node {
}
}
func (n FunctionCall) Name() string {
return "FunctionCall"
}
func (n FunctionCall) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type Include struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
@ -13,17 +12,12 @@ type Include struct {
func NewInclude(expression node.Node) node.Node {
return Include{
"Include",
map[string]interface{}{},
nil,
expression,
}
}
func (n Include) Name() string {
return "Include"
}
func (n Include) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type IncludeOnce struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
@ -13,17 +12,12 @@ type IncludeOnce struct {
func NewIncludeOnce(expression node.Node) node.Node {
return IncludeOnce{
"IncludeOnce",
map[string]interface{}{},
nil,
expression,
}
}
func (n IncludeOnce) Name() string {
return "IncludeOnce"
}
func (n IncludeOnce) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type InstanceOf struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
@ -14,7 +13,6 @@ type InstanceOf struct {
func NewInstanceOf(expr node.Node, class node.Node) node.Node {
return InstanceOf{
"InstanceOf",
map[string]interface{}{},
nil,
expr,
@ -22,10 +20,6 @@ func NewInstanceOf(expr node.Node, class node.Node) node.Node {
}
}
func (n InstanceOf) Name() string {
return "InstanceOf"
}
func (n InstanceOf) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type Isset struct {
name string
attributes map[string]interface{}
position *node.Position
variables []node.Node
@ -13,17 +12,12 @@ type Isset struct {
func NewIsset(variables []node.Node) node.Node {
return Isset{
"Isset",
map[string]interface{}{},
nil,
variables,
}
}
func (n Isset) Name() string {
return "Isset"
}
func (n Isset) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type List struct {
name string
attributes map[string]interface{}
position *node.Position
items []node.Node
@ -13,17 +12,12 @@ type List struct {
func NewList(items []node.Node) node.Node {
return List{
"List",
map[string]interface{}{},
nil,
items,
}
}
func (n List) Name() string {
return "List"
}
func (n List) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type MethodCall struct {
name string
attributes map[string]interface{}
position *node.Position
variable node.Node
@ -15,7 +14,6 @@ type MethodCall struct {
func NewMethodCall(variable node.Node, method node.Node, arguments []node.Node) node.Node {
return MethodCall{
"MethodCall",
map[string]interface{}{},
nil,
variable,
@ -24,10 +22,6 @@ func NewMethodCall(variable node.Node, method node.Node, arguments []node.Node)
}
}
func (n MethodCall) Name() string {
return "MethodCall"
}
func (n MethodCall) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type New struct {
name string
attributes map[string]interface{}
position *node.Position
class node.Node
@ -14,7 +13,6 @@ type New struct {
func NewNew(class node.Node, arguments []node.Node) node.Node {
return New{
"New",
map[string]interface{}{},
nil,
class,
@ -22,10 +20,6 @@ func NewNew(class node.Node, arguments []node.Node) node.Node {
}
}
func (n New) Name() string {
return "New"
}
func (n New) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type PostDec struct {
name string
attributes map[string]interface{}
position *node.Position
variable node.Node
@ -13,17 +12,12 @@ type PostDec struct {
func NewPostDec(variable node.Node) node.Node {
return PostDec{
"PostDec",
map[string]interface{}{},
nil,
variable,
}
}
func (n PostDec) Name() string {
return "PostDec"
}
func (n PostDec) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type PostInc struct {
name string
attributes map[string]interface{}
position *node.Position
variable node.Node
@ -13,17 +12,12 @@ type PostInc struct {
func NewPostInc(variable node.Node) node.Node {
return PostInc{
"PostInc",
map[string]interface{}{},
nil,
variable,
}
}
func (n PostInc) Name() string {
return "PostInc"
}
func (n PostInc) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type PreDec struct {
name string
attributes map[string]interface{}
position *node.Position
variable node.Node
@ -13,17 +12,12 @@ type PreDec struct {
func NewPreDec(variable node.Node) node.Node {
return PreDec{
"PreDec",
map[string]interface{}{},
nil,
variable,
}
}
func (n PreDec) Name() string {
return "PreDec"
}
func (n PreDec) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type PreInc struct {
name string
attributes map[string]interface{}
position *node.Position
variable node.Node
@ -13,17 +12,12 @@ type PreInc struct {
func NewPreInc(variable node.Node) node.Node {
return PreInc{
"PreInc",
map[string]interface{}{},
nil,
variable,
}
}
func (n PreInc) Name() string {
return "PreInc"
}
func (n PreInc) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type Print struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
@ -13,17 +12,12 @@ type Print struct {
func NewPrint(expression node.Node) node.Node {
return Print{
"Print",
map[string]interface{}{},
nil,
expression,
}
}
func (n Print) Name() string {
return "Print"
}
func (n Print) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type PropertyFetch struct {
name string
attributes map[string]interface{}
position *node.Position
variable node.Node
@ -14,7 +13,6 @@ type PropertyFetch struct {
func NewPropertyFetch(variable node.Node, property node.Node) node.Node {
return PropertyFetch{
"PropertyFetch",
map[string]interface{}{},
nil,
variable,
@ -22,10 +20,6 @@ func NewPropertyFetch(variable node.Node, property node.Node) node.Node {
}
}
func (n PropertyFetch) Name() string {
return "PropertyFetch"
}
func (n PropertyFetch) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type Require struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
@ -13,17 +12,12 @@ type Require struct {
func NewRequire(expression node.Node) node.Node {
return Require{
"Require",
map[string]interface{}{},
nil,
expression,
}
}
func (n Require) Name() string {
return "Require"
}
func (n Require) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type RequireOnce struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
@ -13,17 +12,12 @@ type RequireOnce struct {
func NewRequireOnce(expression node.Node) node.Node {
return RequireOnce{
"RequireOnce",
map[string]interface{}{},
nil,
expression,
}
}
func (n RequireOnce) Name() string {
return "RequireOnce"
}
func (n RequireOnce) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type ShellExec struct {
name string
attributes map[string]interface{}
position *node.Position
parts []node.Node
@ -13,17 +12,12 @@ type ShellExec struct {
func NewShellExec(parts []node.Node) node.Node {
return ShellExec{
"ShellExec",
map[string]interface{}{},
nil,
parts,
}
}
func (n ShellExec) Name() string {
return "ShellExec"
}
func (n ShellExec) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type ShortArray struct {
name string
attributes map[string]interface{}
position *node.Position
items []node.Node
@ -13,17 +12,12 @@ type ShortArray struct {
func NewShortArray(items []node.Node) node.Node {
return ShortArray{
"ShortArray",
map[string]interface{}{},
nil,
items,
}
}
func (n ShortArray) Name() string {
return "ShortArray"
}
func (n ShortArray) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type ShortList struct {
name string
attributes map[string]interface{}
position *node.Position
items []node.Node
@ -13,17 +12,12 @@ type ShortList struct {
func NewShortList(items []node.Node) node.Node {
return ShortList{
"ShortList",
map[string]interface{}{},
nil,
items,
}
}
func (n ShortList) Name() string {
return "ShortList"
}
func (n ShortList) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type StaticCall struct {
name string
attributes map[string]interface{}
position *node.Position
class node.Node
@ -15,7 +14,6 @@ type StaticCall struct {
func NewStaticCall(class node.Node, call node.Node, arguments []node.Node) node.Node {
return StaticCall{
"StaticCall",
map[string]interface{}{},
nil,
class,
@ -24,10 +22,6 @@ func NewStaticCall(class node.Node, call node.Node, arguments []node.Node) node.
}
}
func (n StaticCall) Name() string {
return "StaticCall"
}
func (n StaticCall) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type StaticPropertyFetch struct {
name string
attributes map[string]interface{}
position *node.Position
class node.Node
@ -14,7 +13,6 @@ type StaticPropertyFetch struct {
func NewStaticPropertyFetch(class node.Node, property node.Node) node.Node {
return StaticPropertyFetch{
"StaticPropertyFetch",
map[string]interface{}{},
nil,
class,
@ -22,10 +20,6 @@ func NewStaticPropertyFetch(class node.Node, property node.Node) node.Node {
}
}
func (n StaticPropertyFetch) Name() string {
return "StaticPropertyFetch"
}
func (n StaticPropertyFetch) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type Ternary struct {
name string
attributes map[string]interface{}
position *node.Position
condition node.Node
@ -15,7 +14,6 @@ type Ternary struct {
func NewTernary(condition node.Node, ifTrue node.Node, ifFalse node.Node) node.Node {
return Ternary{
"Ternary",
map[string]interface{}{},
nil,
condition,
@ -24,10 +22,6 @@ func NewTernary(condition node.Node, ifTrue node.Node, ifFalse node.Node) node.N
}
}
func (n Ternary) Name() string {
return "Ternary"
}
func (n Ternary) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type UnaryMinus struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
@ -13,17 +12,12 @@ type UnaryMinus struct {
func NewUnaryMinus(expression node.Node) node.Node {
return UnaryMinus{
"UnaryMinus",
map[string]interface{}{},
nil,
expression,
}
}
func (n UnaryMinus) Name() string {
return "UnaryMinus"
}
func (n UnaryMinus) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type UnaryPlus struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
@ -13,17 +12,12 @@ type UnaryPlus struct {
func NewUnaryPlus(expression node.Node) node.Node {
return UnaryPlus{
"UnaryPlus",
map[string]interface{}{},
nil,
expression,
}
}
func (n UnaryPlus) Name() string {
return "UnaryPlus"
}
func (n UnaryPlus) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type Variable struct {
name string
attributes map[string]interface{}
position *node.Position
varName node.Node
@ -13,17 +12,12 @@ type Variable struct {
func NewVariable(varName node.Node) node.Node {
return Variable{
"Variable",
map[string]interface{}{},
nil,
varName,
}
}
func (n Variable) Name() string {
return "Variable"
}
func (n Variable) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type Yield struct {
name string
attributes map[string]interface{}
position *node.Position
key node.Node
@ -14,7 +13,6 @@ type Yield struct {
func NewYield(key node.Node, value node.Node) node.Node {
return Yield{
"Yield",
map[string]interface{}{},
nil,
key,
@ -22,10 +20,6 @@ func NewYield(key node.Node, value node.Node) node.Node {
}
}
func (n Yield) Name() string {
return "Yield"
}
func (n Yield) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,7 +5,6 @@ import (
)
type YieldFrom struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
@ -13,17 +12,12 @@ type YieldFrom struct {
func NewYieldFrom(expression node.Node) node.Node {
return YieldFrom{
"YieldFrom",
map[string]interface{}{},
nil,
expression,
}
}
func (n YieldFrom) Name() string {
return "YieldFrom"
}
func (n YieldFrom) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,14 +5,12 @@ import (
)
type Identifier struct {
name string
attributes map[string]interface{}
position *Position
}
func NewIdentifier(token token.Token) Node {
return Identifier{
"Identifier",
map[string]interface{}{
"value": token.Value,
},
@ -20,10 +18,6 @@ func NewIdentifier(token token.Token) Node {
}
}
func (n Identifier) Name() string {
return "Identifier"
}
func (n Identifier) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,13 +5,12 @@ import (
)
type FullyQualified struct {
NameNode
Name
}
func NewFullyQualified(parts []node.Node) node.Node {
return FullyQualified{
NameNode{
"FullyQualifiedName",
Name{
map[string]interface{}{},
nil,
parts,
@ -19,10 +18,6 @@ func NewFullyQualified(parts []node.Node) node.Node {
}
}
func (n FullyQualified) Name() string {
return "FullyQualified"
}
func (n FullyQualified) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -4,49 +4,43 @@ import (
"github.com/z7zmey/php-parser/node"
)
type NameNode struct {
name string
type Name struct {
attributes map[string]interface{}
position *node.Position
parts []node.Node
}
func NewName(parts []node.Node) node.Node {
return NameNode{
"Name",
return Name{
map[string]interface{}{},
nil,
parts,
}
}
func (n NameNode) Name() string {
return "Name"
}
func (n NameNode) Attributes() map[string]interface{} {
func (n Name) Attributes() map[string]interface{} {
return n.attributes
}
func (n NameNode) Attribute(key string) interface{} {
func (n Name) Attribute(key string) interface{} {
return n.attributes[key]
}
func (n NameNode) SetAttribute(key string, value interface{}) node.Node {
func (n Name) SetAttribute(key string, value interface{}) node.Node {
n.attributes[key] = value
return n
}
func (n NameNode) Position() *node.Position {
func (n Name) Position() *node.Position {
return n.position
}
func (n NameNode) SetPosition(p *node.Position) node.Node {
func (n Name) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n NameNode) Walk(v node.Visitor) {
func (n Name) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return
}

View File

@ -5,14 +5,12 @@ import (
)
type NamePart struct {
name string
attributes map[string]interface{}
position *node.Position
}
func NewNamePart(value string) node.Node {
return NamePart{
"NamePart",
map[string]interface{}{
"value": value,
},
@ -20,10 +18,6 @@ func NewNamePart(value string) node.Node {
}
}
func (n NamePart) Name() string {
return "NamePart"
}
func (n NamePart) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,13 +5,12 @@ import (
)
type Relative struct {
NameNode
Name
}
func NewRelative(parts []node.Node) node.Node {
return Relative{
NameNode{
"RelativeName",
Name{
map[string]interface{}{},
nil,
parts,
@ -19,10 +18,6 @@ func NewRelative(parts []node.Node) node.Node {
}
}
func (n Relative) Name() string {
return "Relative"
}
func (n Relative) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -3,7 +3,6 @@ package node
type Node interface {
Attributer
Positioner
Name() string
Walk(v Visitor)
}

Some files were not shown because too many files have changed in this diff Show More