diff --git a/dumper.go b/dumper.go index 2ee57a9..715e344 100644 --- a/dumper.go +++ b/dumper.go @@ -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) } diff --git a/node/argument.go b/node/argument.go index ab2d6a8..26b5f25 100644 --- a/node/argument.go +++ b/node/argument.go @@ -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 } diff --git a/node/expr/array.go b/node/expr/array.go index 88a4221..0acd346 100644 --- a/node/expr/array.go +++ b/node/expr/array.go @@ -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 } diff --git a/node/expr/array_dim_fetch.go b/node/expr/array_dim_fetch.go index 7e84df9..3fa99d7 100644 --- a/node/expr/array_dim_fetch.go +++ b/node/expr/array_dim_fetch.go @@ -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 } diff --git a/node/expr/array_item.go b/node/expr/array_item.go index 34a13e6..312667e 100644 --- a/node/expr/array_item.go +++ b/node/expr/array_item.go @@ -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 } diff --git a/node/expr/assign_op/assign.go b/node/expr/assign_op/assign.go index 18b0680..064230d 100644 --- a/node/expr/assign_op/assign.go +++ b/node/expr/assign_op/assign.go @@ -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 } diff --git a/node/expr/assign_op/assign_op.go b/node/expr/assign_op/assign_op.go index ec8bf7b..8b1ff53 100644 --- a/node/expr/assign_op/assign_op.go +++ b/node/expr/assign_op/assign_op.go @@ -5,7 +5,6 @@ import ( ) type AssignOp struct { - name string attributes map[string]interface{} position *node.Position variable node.Node diff --git a/node/expr/assign_op/assign_ref.go b/node/expr/assign_op/assign_ref.go index 5be60a1..cdb7eb0 100644 --- a/node/expr/assign_op/assign_ref.go +++ b/node/expr/assign_op/assign_ref.go @@ -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 } diff --git a/node/expr/assign_op/bitwise_and.go b/node/expr/assign_op/bitwise_and.go index eabcbc1..a403f22 100644 --- a/node/expr/assign_op/bitwise_and.go +++ b/node/expr/assign_op/bitwise_and.go @@ -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 } diff --git a/node/expr/assign_op/bitwise_or.go b/node/expr/assign_op/bitwise_or.go index 8a85cd7..d311e7c 100644 --- a/node/expr/assign_op/bitwise_or.go +++ b/node/expr/assign_op/bitwise_or.go @@ -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 } diff --git a/node/expr/assign_op/bitwise_xor.go b/node/expr/assign_op/bitwise_xor.go index 1277b76..c869402 100644 --- a/node/expr/assign_op/bitwise_xor.go +++ b/node/expr/assign_op/bitwise_xor.go @@ -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 diff --git a/node/expr/assign_op/concat.go b/node/expr/assign_op/concat.go index e0c2fe5..152bb79 100644 --- a/node/expr/assign_op/concat.go +++ b/node/expr/assign_op/concat.go @@ -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 } diff --git a/node/expr/assign_op/div.go b/node/expr/assign_op/div.go index bc3ad58..8ab3465 100644 --- a/node/expr/assign_op/div.go +++ b/node/expr/assign_op/div.go @@ -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 } diff --git a/node/expr/assign_op/minus.go b/node/expr/assign_op/minus.go index 3b909f4..a01bd73 100644 --- a/node/expr/assign_op/minus.go +++ b/node/expr/assign_op/minus.go @@ -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 } diff --git a/node/expr/assign_op/mod.go b/node/expr/assign_op/mod.go index b217443..e55c011 100644 --- a/node/expr/assign_op/mod.go +++ b/node/expr/assign_op/mod.go @@ -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 } diff --git a/node/expr/assign_op/mul.go b/node/expr/assign_op/mul.go index d474116..db56047 100644 --- a/node/expr/assign_op/mul.go +++ b/node/expr/assign_op/mul.go @@ -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 } diff --git a/node/expr/assign_op/plus.go b/node/expr/assign_op/plus.go index 0633912..3ed5384 100644 --- a/node/expr/assign_op/plus.go +++ b/node/expr/assign_op/plus.go @@ -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 } diff --git a/node/expr/assign_op/pow.go b/node/expr/assign_op/pow.go index 70bed06..117cad2 100644 --- a/node/expr/assign_op/pow.go +++ b/node/expr/assign_op/pow.go @@ -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 } diff --git a/node/expr/assign_op/shift_left.go b/node/expr/assign_op/shift_left.go index c4e4218..a6576bf 100644 --- a/node/expr/assign_op/shift_left.go +++ b/node/expr/assign_op/shift_left.go @@ -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 } diff --git a/node/expr/assign_op/shift_right.go b/node/expr/assign_op/shift_right.go index 5cea7dc..2b46161 100644 --- a/node/expr/assign_op/shift_right.go +++ b/node/expr/assign_op/shift_right.go @@ -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 } diff --git a/node/expr/binary_op/binary_op.go b/node/expr/binary_op/binary_op.go index 9dc10d6..79b2baa 100644 --- a/node/expr/binary_op/binary_op.go +++ b/node/expr/binary_op/binary_op.go @@ -5,7 +5,6 @@ import ( ) type BinaryOp struct { - name string attributes map[string]interface{} position *node.Position left node.Node diff --git a/node/expr/binary_op/bitwise_and.go b/node/expr/binary_op/bitwise_and.go index 97416f5..1b4a1eb 100644 --- a/node/expr/binary_op/bitwise_and.go +++ b/node/expr/binary_op/bitwise_and.go @@ -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 } diff --git a/node/expr/binary_op/bitwise_or.go b/node/expr/binary_op/bitwise_or.go index 7d4740f..bc5f9ea 100644 --- a/node/expr/binary_op/bitwise_or.go +++ b/node/expr/binary_op/bitwise_or.go @@ -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 diff --git a/node/expr/binary_op/bitwise_xor.go b/node/expr/binary_op/bitwise_xor.go index f7eb122..e3cfac1 100644 --- a/node/expr/binary_op/bitwise_xor.go +++ b/node/expr/binary_op/bitwise_xor.go @@ -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 diff --git a/node/expr/binary_op/boolean_and.go b/node/expr/binary_op/boolean_and.go index 5207e41..2985fc4 100644 --- a/node/expr/binary_op/boolean_and.go +++ b/node/expr/binary_op/boolean_and.go @@ -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 } diff --git a/node/expr/binary_op/boolean_or.go b/node/expr/binary_op/boolean_or.go index ffee468..10731c4 100644 --- a/node/expr/binary_op/boolean_or.go +++ b/node/expr/binary_op/boolean_or.go @@ -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 } diff --git a/node/expr/binary_op/coalesce.go b/node/expr/binary_op/coalesce.go index eb04e58..a8183bb 100644 --- a/node/expr/binary_op/coalesce.go +++ b/node/expr/binary_op/coalesce.go @@ -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 } diff --git a/node/expr/binary_op/concat.go b/node/expr/binary_op/concat.go index ca3cbfd..5b623e6 100644 --- a/node/expr/binary_op/concat.go +++ b/node/expr/binary_op/concat.go @@ -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 } diff --git a/node/expr/binary_op/div.go b/node/expr/binary_op/div.go index fdc946a..eb32611 100644 --- a/node/expr/binary_op/div.go +++ b/node/expr/binary_op/div.go @@ -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 } diff --git a/node/expr/binary_op/equal.go b/node/expr/binary_op/equal.go index a257a19..e82ddc2 100644 --- a/node/expr/binary_op/equal.go +++ b/node/expr/binary_op/equal.go @@ -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 } diff --git a/node/expr/binary_op/greater.go b/node/expr/binary_op/greater.go index 9052de7..6b2ce2b 100644 --- a/node/expr/binary_op/greater.go +++ b/node/expr/binary_op/greater.go @@ -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 } diff --git a/node/expr/binary_op/greater_or_equal.go b/node/expr/binary_op/greater_or_equal.go index e12ae9f..a0c6165 100644 --- a/node/expr/binary_op/greater_or_equal.go +++ b/node/expr/binary_op/greater_or_equal.go @@ -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 } diff --git a/node/expr/binary_op/identical.go b/node/expr/binary_op/identical.go index 2fb2466..0b71f05 100644 --- a/node/expr/binary_op/identical.go +++ b/node/expr/binary_op/identical.go @@ -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 } diff --git a/node/expr/binary_op/logical_and.go b/node/expr/binary_op/logical_and.go index fba141a..ba81ba3 100644 --- a/node/expr/binary_op/logical_and.go +++ b/node/expr/binary_op/logical_and.go @@ -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 } diff --git a/node/expr/binary_op/logical_or.go b/node/expr/binary_op/logical_or.go index 60d88cd..16afd9b 100644 --- a/node/expr/binary_op/logical_or.go +++ b/node/expr/binary_op/logical_or.go @@ -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 } diff --git a/node/expr/binary_op/logical_xor.go b/node/expr/binary_op/logical_xor.go index 6b54a45..8a7c87e 100644 --- a/node/expr/binary_op/logical_xor.go +++ b/node/expr/binary_op/logical_xor.go @@ -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 } diff --git a/node/expr/binary_op/minus.go b/node/expr/binary_op/minus.go index e7865c9..daba4c0 100644 --- a/node/expr/binary_op/minus.go +++ b/node/expr/binary_op/minus.go @@ -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 } diff --git a/node/expr/binary_op/mod.go b/node/expr/binary_op/mod.go index b5414d6..f8e8820 100644 --- a/node/expr/binary_op/mod.go +++ b/node/expr/binary_op/mod.go @@ -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 } diff --git a/node/expr/binary_op/mul.go b/node/expr/binary_op/mul.go index 14a7147..0c40a58 100644 --- a/node/expr/binary_op/mul.go +++ b/node/expr/binary_op/mul.go @@ -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 } diff --git a/node/expr/binary_op/not_equal.go b/node/expr/binary_op/not_equal.go index 1650b12..5396679 100644 --- a/node/expr/binary_op/not_equal.go +++ b/node/expr/binary_op/not_equal.go @@ -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 } diff --git a/node/expr/binary_op/not_identical.go b/node/expr/binary_op/not_identical.go index df79f09..74dad65 100644 --- a/node/expr/binary_op/not_identical.go +++ b/node/expr/binary_op/not_identical.go @@ -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 } diff --git a/node/expr/binary_op/plus.go b/node/expr/binary_op/plus.go index 29dcc5c..31370d5 100644 --- a/node/expr/binary_op/plus.go +++ b/node/expr/binary_op/plus.go @@ -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 } diff --git a/node/expr/binary_op/pow.go b/node/expr/binary_op/pow.go index b94a85a..868b051 100644 --- a/node/expr/binary_op/pow.go +++ b/node/expr/binary_op/pow.go @@ -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 } diff --git a/node/expr/binary_op/shift_left.go b/node/expr/binary_op/shift_left.go index 446acad..1ca013a 100644 --- a/node/expr/binary_op/shift_left.go +++ b/node/expr/binary_op/shift_left.go @@ -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 } diff --git a/node/expr/binary_op/shift_right.go b/node/expr/binary_op/shift_right.go index ffc2629..4dd8604 100644 --- a/node/expr/binary_op/shift_right.go +++ b/node/expr/binary_op/shift_right.go @@ -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 } diff --git a/node/expr/binary_op/smaller.go b/node/expr/binary_op/smaller.go index 5a93d97..e2dbb31 100644 --- a/node/expr/binary_op/smaller.go +++ b/node/expr/binary_op/smaller.go @@ -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 } diff --git a/node/expr/binary_op/smaller_or_equal.go b/node/expr/binary_op/smaller_or_equal.go index 5577a89..eaf9718 100644 --- a/node/expr/binary_op/smaller_or_equal.go +++ b/node/expr/binary_op/smaller_or_equal.go @@ -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 } diff --git a/node/expr/binary_op/spaceship.go b/node/expr/binary_op/spaceship.go index d6ac00a..9f9fa9b 100644 --- a/node/expr/binary_op/spaceship.go +++ b/node/expr/binary_op/spaceship.go @@ -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 } diff --git a/node/expr/bitwise_not.go b/node/expr/bitwise_not.go index ffcce38..abaa508 100644 --- a/node/expr/bitwise_not.go +++ b/node/expr/bitwise_not.go @@ -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 } diff --git a/node/expr/boolean_not.go b/node/expr/boolean_not.go index 8329040..a0850eb 100644 --- a/node/expr/boolean_not.go +++ b/node/expr/boolean_not.go @@ -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 } diff --git a/node/expr/cast/cast.go b/node/expr/cast/cast.go index 6891866..4dc14cc 100644 --- a/node/expr/cast/cast.go +++ b/node/expr/cast/cast.go @@ -5,7 +5,6 @@ import ( ) type Cast struct { - name string attributes map[string]interface{} position *node.Position expr node.Node diff --git a/node/expr/cast/cast_array.go b/node/expr/cast/cast_array.go index 3638307..b737792 100644 --- a/node/expr/cast/cast_array.go +++ b/node/expr/cast/cast_array.go @@ -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 } diff --git a/node/expr/cast/cast_bool.go b/node/expr/cast/cast_bool.go index a2bf0c0..feecea6 100644 --- a/node/expr/cast/cast_bool.go +++ b/node/expr/cast/cast_bool.go @@ -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 } diff --git a/node/expr/cast/cast_double.go b/node/expr/cast/cast_double.go index c3a0e88..f74be8a 100644 --- a/node/expr/cast/cast_double.go +++ b/node/expr/cast/cast_double.go @@ -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 } diff --git a/node/expr/cast/cast_int.go b/node/expr/cast/cast_int.go index 3cc4b1b..d125cd8 100644 --- a/node/expr/cast/cast_int.go +++ b/node/expr/cast/cast_int.go @@ -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 } diff --git a/node/expr/cast/cast_object.go b/node/expr/cast/cast_object.go index f8af5cf..d66cb1b 100644 --- a/node/expr/cast/cast_object.go +++ b/node/expr/cast/cast_object.go @@ -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 } diff --git a/node/expr/cast/cast_string.go b/node/expr/cast/cast_string.go index db02f5b..929e7b9 100644 --- a/node/expr/cast/cast_string.go +++ b/node/expr/cast/cast_string.go @@ -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 } diff --git a/node/expr/cast/cast_unset.go b/node/expr/cast/cast_unset.go index 1baa099..3e54841 100644 --- a/node/expr/cast/cast_unset.go +++ b/node/expr/cast/cast_unset.go @@ -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 } diff --git a/node/expr/class_const_fetch.go b/node/expr/class_const_fetch.go index 516bf6d..d69693d 100644 --- a/node/expr/class_const_fetch.go +++ b/node/expr/class_const_fetch.go @@ -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 } diff --git a/node/expr/clone.go b/node/expr/clone.go index 8f8a14c..8a8e802 100644 --- a/node/expr/clone.go +++ b/node/expr/clone.go @@ -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 } diff --git a/node/expr/closure.go b/node/expr/closure.go index 4a9bcef..14bf951 100644 --- a/node/expr/closure.go +++ b/node/expr/closure.go @@ -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 } diff --git a/node/expr/closure_use.go b/node/expr/closure_use.go index 71ae58e..a4a77af 100644 --- a/node/expr/closure_use.go +++ b/node/expr/closure_use.go @@ -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 } diff --git a/node/expr/const_fetch.go b/node/expr/const_fetch.go index 42df3d0..08a1daf 100644 --- a/node/expr/const_fetch.go +++ b/node/expr/const_fetch.go @@ -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 } diff --git a/node/expr/empty.go b/node/expr/empty.go index e5f3346..ab2b19d 100644 --- a/node/expr/empty.go +++ b/node/expr/empty.go @@ -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 } diff --git a/node/expr/error_suppress.go b/node/expr/error_suppress.go index 30b6685..fb07754 100644 --- a/node/expr/error_suppress.go +++ b/node/expr/error_suppress.go @@ -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 } diff --git a/node/expr/eval.go b/node/expr/eval.go index 97e34ff..46454ca 100644 --- a/node/expr/eval.go +++ b/node/expr/eval.go @@ -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 } diff --git a/node/expr/exit.go b/node/expr/exit.go index da1052d..4d6fb48 100644 --- a/node/expr/exit.go +++ b/node/expr/exit.go @@ -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 } diff --git a/node/expr/function_call.go b/node/expr/function_call.go index 0e3db07..dbcd024 100644 --- a/node/expr/function_call.go +++ b/node/expr/function_call.go @@ -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 } diff --git a/node/expr/include.go b/node/expr/include.go index dc247f5..6deb185 100644 --- a/node/expr/include.go +++ b/node/expr/include.go @@ -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 } diff --git a/node/expr/include_once.go b/node/expr/include_once.go index 3c45aa9..8997933 100644 --- a/node/expr/include_once.go +++ b/node/expr/include_once.go @@ -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 } diff --git a/node/expr/instance_of.go b/node/expr/instance_of.go index ecb3ebe..503f7d1 100644 --- a/node/expr/instance_of.go +++ b/node/expr/instance_of.go @@ -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 } diff --git a/node/expr/isset.go b/node/expr/isset.go index 43fe7d9..725da82 100644 --- a/node/expr/isset.go +++ b/node/expr/isset.go @@ -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 } diff --git a/node/expr/list.go b/node/expr/list.go index 5c613d3..549301f 100644 --- a/node/expr/list.go +++ b/node/expr/list.go @@ -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 } diff --git a/node/expr/method_call.go b/node/expr/method_call.go index ab73231..9e96384 100644 --- a/node/expr/method_call.go +++ b/node/expr/method_call.go @@ -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 } diff --git a/node/expr/new.go b/node/expr/new.go index b2800e4..eaa7e7b 100644 --- a/node/expr/new.go +++ b/node/expr/new.go @@ -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 } diff --git a/node/expr/post_dec.go b/node/expr/post_dec.go index d3e55bc..a0fc1ff 100644 --- a/node/expr/post_dec.go +++ b/node/expr/post_dec.go @@ -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 } diff --git a/node/expr/post_inc.go b/node/expr/post_inc.go index 7e9ee78..0731a8a 100644 --- a/node/expr/post_inc.go +++ b/node/expr/post_inc.go @@ -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 } diff --git a/node/expr/pre_dec.go b/node/expr/pre_dec.go index 4e0b255..0e194af 100644 --- a/node/expr/pre_dec.go +++ b/node/expr/pre_dec.go @@ -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 } diff --git a/node/expr/pre_inc.go b/node/expr/pre_inc.go index 0f06e0e..5243b28 100644 --- a/node/expr/pre_inc.go +++ b/node/expr/pre_inc.go @@ -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 } diff --git a/node/expr/print.go b/node/expr/print.go index 2fa2f45..59e5297 100644 --- a/node/expr/print.go +++ b/node/expr/print.go @@ -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 } diff --git a/node/expr/property_fetch.go b/node/expr/property_fetch.go index 6a651a5..3f1e3d0 100644 --- a/node/expr/property_fetch.go +++ b/node/expr/property_fetch.go @@ -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 } diff --git a/node/expr/require.go b/node/expr/require.go index 9c5cbde..b6308b3 100644 --- a/node/expr/require.go +++ b/node/expr/require.go @@ -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 } diff --git a/node/expr/require_once.go b/node/expr/require_once.go index b62562a..5e5353e 100644 --- a/node/expr/require_once.go +++ b/node/expr/require_once.go @@ -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 } diff --git a/node/expr/shell_exec.go b/node/expr/shell_exec.go index 56892b5..41f0e63 100644 --- a/node/expr/shell_exec.go +++ b/node/expr/shell_exec.go @@ -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 } diff --git a/node/expr/short_array.go b/node/expr/short_array.go index b4f1cff..f92c111 100644 --- a/node/expr/short_array.go +++ b/node/expr/short_array.go @@ -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 } diff --git a/node/expr/short_list.go b/node/expr/short_list.go index 7c321b9..2c9afd1 100644 --- a/node/expr/short_list.go +++ b/node/expr/short_list.go @@ -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 } diff --git a/node/expr/static_call.go b/node/expr/static_call.go index 8585db4..e1411b0 100644 --- a/node/expr/static_call.go +++ b/node/expr/static_call.go @@ -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 } diff --git a/node/expr/static_property_fetch.go b/node/expr/static_property_fetch.go index bf9f386..b377fcd 100644 --- a/node/expr/static_property_fetch.go +++ b/node/expr/static_property_fetch.go @@ -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 } diff --git a/node/expr/ternary.go b/node/expr/ternary.go index a924a25..e0cdbc5 100644 --- a/node/expr/ternary.go +++ b/node/expr/ternary.go @@ -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 } diff --git a/node/expr/unary_minus.go b/node/expr/unary_minus.go index 708eacf..3ae5c39 100644 --- a/node/expr/unary_minus.go +++ b/node/expr/unary_minus.go @@ -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 } diff --git a/node/expr/unary_plus.go b/node/expr/unary_plus.go index 5b1b482..f84eaae 100644 --- a/node/expr/unary_plus.go +++ b/node/expr/unary_plus.go @@ -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 } diff --git a/node/expr/variable.go b/node/expr/variable.go index 7632a3b..a0d0da3 100644 --- a/node/expr/variable.go +++ b/node/expr/variable.go @@ -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 } diff --git a/node/expr/yield.go b/node/expr/yield.go index 2e792a7..07d6956 100644 --- a/node/expr/yield.go +++ b/node/expr/yield.go @@ -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 } diff --git a/node/expr/yield_from.go b/node/expr/yield_from.go index 590e467..af82584 100644 --- a/node/expr/yield_from.go +++ b/node/expr/yield_from.go @@ -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 } diff --git a/node/identifier.go b/node/identifier.go index 79a0b31..eb903e1 100644 --- a/node/identifier.go +++ b/node/identifier.go @@ -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 } diff --git a/node/name/fully_qualified.go b/node/name/fully_qualified.go index 6e3a242..fe83e2a 100644 --- a/node/name/fully_qualified.go +++ b/node/name/fully_qualified.go @@ -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 } diff --git a/node/name/name.go b/node/name/name.go index 59944c7..8bed000 100644 --- a/node/name/name.go +++ b/node/name/name.go @@ -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 } diff --git a/node/name/name_part.go b/node/name/name_part.go index b56e3f3..f10292e 100644 --- a/node/name/name_part.go +++ b/node/name/name_part.go @@ -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 } diff --git a/node/name/relative.go b/node/name/relative.go index dc4bfc2..0b14bd6 100644 --- a/node/name/relative.go +++ b/node/name/relative.go @@ -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 } diff --git a/node/node.go b/node/node.go index 6130ebe..39f94b9 100644 --- a/node/node.go +++ b/node/node.go @@ -3,7 +3,6 @@ package node type Node interface { Attributer Positioner - Name() string Walk(v Visitor) } diff --git a/node/nullable.go b/node/nullable.go index 93f525d..6c61667 100644 --- a/node/nullable.go +++ b/node/nullable.go @@ -1,7 +1,6 @@ package node type Nullable struct { - name string attributes map[string]interface{} position *Position expr Node @@ -9,17 +8,12 @@ type Nullable struct { func NewNullable(expression Node) Node { return Nullable{ - "Nullable", map[string]interface{}{}, nil, expression, } } -func (n Nullable) Name() string { - return "Nullable" -} - func (n Nullable) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/parameter.go b/node/parameter.go index 40fa20c..4ed4fd5 100644 --- a/node/parameter.go +++ b/node/parameter.go @@ -1,7 +1,6 @@ package node type Parameter struct { - name string attributes map[string]interface{} position *Position variableType Node @@ -11,7 +10,6 @@ type Parameter struct { func NewParameter(variableType Node, variable Node, defaultValue Node, byRef bool, variadic bool) Node { return Parameter{ - "Parameter", map[string]interface{}{ "byRef": byRef, "variadic": variadic, @@ -23,10 +21,6 @@ func NewParameter(variableType Node, variable Node, defaultValue Node, byRef boo } } -func (n Parameter) Name() string { - return "Parameter" -} - func (n Parameter) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/scalar/dnumber.go b/node/scalar/dnumber.go index adf5ed5..fbd5bbb 100644 --- a/node/scalar/dnumber.go +++ b/node/scalar/dnumber.go @@ -5,14 +5,12 @@ import ( ) type Dnumber struct { - name string attributes map[string]interface{} position *node.Position } func NewDnumber(value string) node.Node { return Dnumber{ - "Dnumber", map[string]interface{}{ "value": value, }, @@ -20,10 +18,6 @@ func NewDnumber(value string) node.Node { } } -func (n Dnumber) Name() string { - return "Dnumber" -} - func (n Dnumber) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/scalar/encapsed.go b/node/scalar/encapsed.go index d65df9e..7777ca8 100644 --- a/node/scalar/encapsed.go +++ b/node/scalar/encapsed.go @@ -5,7 +5,6 @@ import ( ) type Encapsed struct { - name string attributes map[string]interface{} position *node.Position parts []node.Node @@ -13,17 +12,12 @@ type Encapsed struct { func NewEncapsed(parts []node.Node) node.Node { return Encapsed{ - "Encapsed", map[string]interface{}{}, nil, parts, } } -func (n Encapsed) Name() string { - return "Encapsed" -} - func (n Encapsed) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/scalar/encapsed_string_part.go b/node/scalar/encapsed_string_part.go index fc2fc2f..a1dd025 100644 --- a/node/scalar/encapsed_string_part.go +++ b/node/scalar/encapsed_string_part.go @@ -5,14 +5,12 @@ import ( ) type EncapsedStringPart struct { - name string attributes map[string]interface{} position *node.Position } func NewEncapsedStringPart(value string) node.Node { return EncapsedStringPart{ - "EncapsedStringPart", map[string]interface{}{ "value": value, }, @@ -20,10 +18,6 @@ func NewEncapsedStringPart(value string) node.Node { } } -func (n EncapsedStringPart) Name() string { - return "EncapsedStringPart" -} - func (n EncapsedStringPart) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/scalar/lnumber.go b/node/scalar/lnumber.go index 7358c24..04c685f 100644 --- a/node/scalar/lnumber.go +++ b/node/scalar/lnumber.go @@ -5,14 +5,12 @@ import ( ) type Lnumber struct { - name string attributes map[string]interface{} position *node.Position } func NewLnumber(value string) node.Node { return Lnumber{ - "Lnumber", map[string]interface{}{ "value": value, }, @@ -20,10 +18,6 @@ func NewLnumber(value string) node.Node { } } -func (n Lnumber) Name() string { - return "Lnumber" -} - func (n Lnumber) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/scalar/magic_constant.go b/node/scalar/magic_constant.go index 36d0848..53425f3 100644 --- a/node/scalar/magic_constant.go +++ b/node/scalar/magic_constant.go @@ -5,14 +5,12 @@ import ( ) type MagicConstant struct { - name string attributes map[string]interface{} position *node.Position } func NewMagicConstant(value string) node.Node { return MagicConstant{ - "MagicConstant", map[string]interface{}{ "value": value, }, @@ -20,10 +18,6 @@ func NewMagicConstant(value string) node.Node { } } -func (n MagicConstant) Name() string { - return "MagicConstant" -} - func (n MagicConstant) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/scalar/string.go b/node/scalar/string.go index c9946c9..3231ea7 100644 --- a/node/scalar/string.go +++ b/node/scalar/string.go @@ -5,14 +5,12 @@ import ( ) type String struct { - name string attributes map[string]interface{} position *node.Position } func NewString(value string) node.Node { return String{ - "String", map[string]interface{}{ "value": value, }, @@ -20,10 +18,6 @@ func NewString(value string) node.Node { } } -func (n String) Name() string { - return "String" -} - func (n String) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/alt_else.go b/node/stmt/alt_else.go index e8c830c..e693561 100644 --- a/node/stmt/alt_else.go +++ b/node/stmt/alt_else.go @@ -5,7 +5,6 @@ import ( ) type AltElse struct { - name string attributes map[string]interface{} position *node.Position stmt node.Node @@ -13,17 +12,12 @@ type AltElse struct { func NewAltElse(stmt node.Node) node.Node { return AltElse{ - "AltElse", map[string]interface{}{}, nil, stmt, } } -func (n AltElse) Name() string { - return "AltElse" -} - func (n AltElse) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/alt_else_if.go b/node/stmt/alt_else_if.go index 4e1f53f..c31db31 100644 --- a/node/stmt/alt_else_if.go +++ b/node/stmt/alt_else_if.go @@ -5,7 +5,6 @@ import ( ) type AltElseIf struct { - name string attributes map[string]interface{} position *node.Position cond node.Node @@ -14,7 +13,6 @@ type AltElseIf struct { func NewAltElseIf(cond node.Node, stmt node.Node) node.Node { return AltElseIf{ - "AltElseIf", map[string]interface{}{}, nil, cond, @@ -22,10 +20,6 @@ func NewAltElseIf(cond node.Node, stmt node.Node) node.Node { } } -func (n AltElseIf) Name() string { - return "AltElseIf" -} - func (n AltElseIf) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/alt_if.go b/node/stmt/alt_if.go index fc12749..af1242e 100644 --- a/node/stmt/alt_if.go +++ b/node/stmt/alt_if.go @@ -5,7 +5,6 @@ import ( ) type AltIf struct { - name string attributes map[string]interface{} position *node.Position cond node.Node @@ -16,7 +15,6 @@ type AltIf struct { func NewAltIf(cond node.Node, stmt node.Node) node.Node { return AltIf{ - "AltIf", map[string]interface{}{}, nil, cond, @@ -26,10 +24,6 @@ func NewAltIf(cond node.Node, stmt node.Node) node.Node { } } -func (n AltIf) Name() string { - return "AltIf" -} - func (n AltIf) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/break.go b/node/stmt/break.go index 9cee2a5..404fc2d 100644 --- a/node/stmt/break.go +++ b/node/stmt/break.go @@ -5,7 +5,6 @@ import ( ) type Break struct { - name string attributes map[string]interface{} position *node.Position expr node.Node @@ -13,17 +12,12 @@ type Break struct { func NewBreak(expr node.Node) node.Node { return Break{ - "Break", map[string]interface{}{}, nil, expr, } } -func (n Break) Name() string { - return "Break" -} - func (n Break) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/case.go b/node/stmt/case.go index 8f9242f..75bd5a5 100644 --- a/node/stmt/case.go +++ b/node/stmt/case.go @@ -5,7 +5,6 @@ import ( ) type Case struct { - name string attributes map[string]interface{} position *node.Position cond node.Node @@ -14,7 +13,6 @@ type Case struct { func NewCase(cond node.Node, stmts []node.Node) node.Node { return Case{ - "Case", map[string]interface{}{}, nil, cond, @@ -22,10 +20,6 @@ func NewCase(cond node.Node, stmts []node.Node) node.Node { } } -func (n Case) Name() string { - return "Case" -} - func (n Case) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/catch.go b/node/stmt/catch.go index 42b3bc8..743efa7 100644 --- a/node/stmt/catch.go +++ b/node/stmt/catch.go @@ -5,7 +5,6 @@ import ( ) type Catch struct { - name string attributes map[string]interface{} position *node.Position types []node.Node @@ -15,7 +14,6 @@ type Catch struct { func NewCatch(types []node.Node, variable node.Node, stmts []node.Node) node.Node { return Catch{ - "Catch", map[string]interface{}{}, nil, types, @@ -24,10 +22,6 @@ func NewCatch(types []node.Node, variable node.Node, stmts []node.Node) node.Nod } } -func (n Catch) Name() string { - return "Catch" -} - func (n Catch) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/class.go b/node/stmt/class.go index 19cf36a..639e2ef 100644 --- a/node/stmt/class.go +++ b/node/stmt/class.go @@ -5,7 +5,6 @@ import ( ) type Class struct { - name string attributes map[string]interface{} position *node.Position className node.Node @@ -18,7 +17,6 @@ type Class struct { func NewClass(className node.Node, modifiers []node.Node, args []node.Node, extends node.Node, implements []node.Node, stmts []node.Node, phpDocComment string) node.Node { return Class{ - "Class", map[string]interface{}{ "phpDocComment": phpDocComment, }, @@ -32,10 +30,6 @@ func NewClass(className node.Node, modifiers []node.Node, args []node.Node, exte } } -func (n Class) Name() string { - return "Class" -} - func (n Class) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/class_const_list.go b/node/stmt/class_const_list.go index 6df5c46..7c1143c 100644 --- a/node/stmt/class_const_list.go +++ b/node/stmt/class_const_list.go @@ -5,7 +5,6 @@ import ( ) type ClassConstList struct { - name string attributes map[string]interface{} position *node.Position modifiers []node.Node @@ -14,7 +13,6 @@ type ClassConstList struct { func NewClassConstList(modifiers []node.Node, consts []node.Node) node.Node { return ClassConstList{ - "ClassConstList", map[string]interface{}{}, nil, modifiers, @@ -22,10 +20,6 @@ func NewClassConstList(modifiers []node.Node, consts []node.Node) node.Node { } } -func (n ClassConstList) Name() string { - return "ClassConstList" -} - func (n ClassConstList) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/class_method.go b/node/stmt/class_method.go index 239a9a0..17e83c5 100644 --- a/node/stmt/class_method.go +++ b/node/stmt/class_method.go @@ -5,7 +5,6 @@ import ( ) type ClassMethod struct { - name string attributes map[string]interface{} position *node.Position methodName node.Node @@ -17,7 +16,6 @@ type ClassMethod struct { func NewClassMethod(methodName node.Node, modifiers []node.Node, returnsRef bool, params []node.Node, returnType node.Node, stmts []node.Node, phpDocComment string) node.Node { return ClassMethod{ - "ClassMethod", map[string]interface{}{ "returnsRef": returnsRef, "phpDocComment": phpDocComment, @@ -31,10 +29,6 @@ func NewClassMethod(methodName node.Node, modifiers []node.Node, returnsRef bool } } -func (n ClassMethod) Name() string { - return "ClassMethod" -} - func (n ClassMethod) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/const_list.go b/node/stmt/const_list.go index a265367..db4fe9a 100644 --- a/node/stmt/const_list.go +++ b/node/stmt/const_list.go @@ -5,7 +5,6 @@ import ( ) type ConstList struct { - name string attributes map[string]interface{} position *node.Position consts []node.Node @@ -13,17 +12,12 @@ type ConstList struct { func NewConstList(consts []node.Node) node.Node { return ConstList{ - "ConstList", map[string]interface{}{}, nil, consts, } } -func (n ConstList) Name() string { - return "ConstList" -} - func (n ConstList) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/constant.go b/node/stmt/constant.go index 15c08df..820c685 100644 --- a/node/stmt/constant.go +++ b/node/stmt/constant.go @@ -5,7 +5,6 @@ import ( ) type Constant struct { - name string attributes map[string]interface{} position *node.Position constantName node.Node @@ -14,7 +13,6 @@ type Constant struct { func NewConstant(constantName node.Node, expr node.Node, phpDocComment string) node.Node { return Constant{ - "Constant", map[string]interface{}{ "phpDocComment": phpDocComment, }, @@ -24,10 +22,6 @@ func NewConstant(constantName node.Node, expr node.Node, phpDocComment string) n } } -func (n Constant) Name() string { - return "Constant" -} - func (n Constant) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/continue.go b/node/stmt/continue.go index c11bca2..88f94da 100644 --- a/node/stmt/continue.go +++ b/node/stmt/continue.go @@ -5,7 +5,6 @@ import ( ) type Continue struct { - name string attributes map[string]interface{} position *node.Position expr node.Node @@ -13,17 +12,12 @@ type Continue struct { func NewContinue(expr node.Node) node.Node { return Continue{ - "Continue", map[string]interface{}{}, nil, expr, } } -func (n Continue) Name() string { - return "Continue" -} - func (n Continue) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/declare.go b/node/stmt/declare.go index 3056599..98c584e 100644 --- a/node/stmt/declare.go +++ b/node/stmt/declare.go @@ -5,7 +5,6 @@ import ( ) type Declare struct { - name string attributes map[string]interface{} position *node.Position consts []node.Node @@ -14,7 +13,6 @@ type Declare struct { func NewDeclare(consts []node.Node, stmt node.Node) node.Node { return Declare{ - "Declare", map[string]interface{}{}, nil, consts, @@ -22,10 +20,6 @@ func NewDeclare(consts []node.Node, stmt node.Node) node.Node { } } -func (n Declare) Name() string { - return "Declare" -} - func (n Declare) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/default.go b/node/stmt/default.go index b3a9c2d..9100add 100644 --- a/node/stmt/default.go +++ b/node/stmt/default.go @@ -5,7 +5,6 @@ import ( ) type Default struct { - name string attributes map[string]interface{} position *node.Position stmts []node.Node @@ -13,17 +12,12 @@ type Default struct { func NewDefault(stmts []node.Node) node.Node { return Default{ - "Default", map[string]interface{}{}, nil, stmts, } } -func (n Default) Name() string { - return "Default" -} - func (n Default) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/do.go b/node/stmt/do.go index 77393e3..f1b2f6a 100644 --- a/node/stmt/do.go +++ b/node/stmt/do.go @@ -5,7 +5,6 @@ import ( ) type Do struct { - name string attributes map[string]interface{} position *node.Position stmt node.Node @@ -14,7 +13,6 @@ type Do struct { func NewDo(stmt node.Node, cond node.Node) node.Node { return Do{ - "Do", map[string]interface{}{}, nil, stmt, @@ -22,10 +20,6 @@ func NewDo(stmt node.Node, cond node.Node) node.Node { } } -func (n Do) Name() string { - return "Do" -} - func (n Do) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/echo.go b/node/stmt/echo.go index 74bebe6..3faf9e5 100644 --- a/node/stmt/echo.go +++ b/node/stmt/echo.go @@ -5,7 +5,6 @@ import ( ) type Echo struct { - name string attributes map[string]interface{} position *node.Position exprs []node.Node @@ -13,17 +12,12 @@ type Echo struct { func NewEcho(exprs []node.Node) node.Node { return Echo{ - "Echo", map[string]interface{}{}, nil, exprs, } } -func (n Echo) Name() string { - return "Echo" -} - func (n Echo) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/else.go b/node/stmt/else.go index 4ce58e5..4efd80b 100644 --- a/node/stmt/else.go +++ b/node/stmt/else.go @@ -5,7 +5,6 @@ import ( ) type Else struct { - name string attributes map[string]interface{} position *node.Position stmt node.Node @@ -13,17 +12,12 @@ type Else struct { func NewElse(stmt node.Node) node.Node { return Else{ - "Else", map[string]interface{}{}, nil, stmt, } } -func (n Else) Name() string { - return "Else" -} - func (n Else) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/else_if.go b/node/stmt/else_if.go index d54b2b9..135363c 100644 --- a/node/stmt/else_if.go +++ b/node/stmt/else_if.go @@ -5,7 +5,6 @@ import ( ) type ElseIf struct { - name string attributes map[string]interface{} position *node.Position cond node.Node @@ -14,7 +13,6 @@ type ElseIf struct { func NewElseIf(cond node.Node, stmt node.Node) node.Node { return ElseIf{ - "ElseIf", map[string]interface{}{}, nil, cond, @@ -22,10 +20,6 @@ func NewElseIf(cond node.Node, stmt node.Node) node.Node { } } -func (n ElseIf) Name() string { - return "ElseIf" -} - func (n ElseIf) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/expression.go b/node/stmt/expression.go index 95a8cbd..f7e69a1 100644 --- a/node/stmt/expression.go +++ b/node/stmt/expression.go @@ -5,7 +5,6 @@ import ( ) type Expression struct { - name string attributes map[string]interface{} position *node.Position expr node.Node @@ -13,17 +12,12 @@ type Expression struct { func NewExpression(expr node.Node) node.Node { return Expression{ - "Expression", map[string]interface{}{}, nil, expr, } } -func (n Expression) Name() string { - return "Expression" -} - func (n Expression) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/finally.go b/node/stmt/finally.go index 4cb907f..25bb298 100644 --- a/node/stmt/finally.go +++ b/node/stmt/finally.go @@ -5,7 +5,6 @@ import ( ) type Finally struct { - name string attributes map[string]interface{} position *node.Position stmts []node.Node @@ -13,17 +12,12 @@ type Finally struct { func NewFinally(stmts []node.Node) node.Node { return Finally{ - "Finally", map[string]interface{}{}, nil, stmts, } } -func (n Finally) Name() string { - return "Finally" -} - func (n Finally) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/for.go b/node/stmt/for.go index 58cfbc6..832d23f 100644 --- a/node/stmt/for.go +++ b/node/stmt/for.go @@ -5,7 +5,6 @@ import ( ) type For struct { - name string attributes map[string]interface{} position *node.Position init []node.Node @@ -16,7 +15,6 @@ type For struct { func NewFor(init []node.Node, cond []node.Node, loop []node.Node, stmt node.Node) node.Node { return For{ - "For", map[string]interface{}{}, nil, init, @@ -26,10 +24,6 @@ func NewFor(init []node.Node, cond []node.Node, loop []node.Node, stmt node.Node } } -func (n For) Name() string { - return "For" -} - func (n For) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/foreach.go b/node/stmt/foreach.go index a5f54dc..7dda65f 100644 --- a/node/stmt/foreach.go +++ b/node/stmt/foreach.go @@ -5,7 +5,6 @@ import ( ) type Foreach struct { - name string attributes map[string]interface{} position *node.Position expr node.Node @@ -16,7 +15,6 @@ type Foreach struct { func NewForeach(expr node.Node, key node.Node, variable node.Node, stmt node.Node, byRef bool) node.Node { return Foreach{ - "Foreach", map[string]interface{}{ "byRef": byRef, }, @@ -28,10 +26,6 @@ func NewForeach(expr node.Node, key node.Node, variable node.Node, stmt node.Nod } } -func (n Foreach) Name() string { - return "Foreach" -} - func (n Foreach) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/function.go b/node/stmt/function.go index 50e6a65..c6d1b0f 100644 --- a/node/stmt/function.go +++ b/node/stmt/function.go @@ -5,7 +5,6 @@ import ( ) type Function struct { - name string attributes map[string]interface{} position *node.Position functionName node.Node @@ -16,7 +15,6 @@ type Function struct { func NewFunction(functionName node.Node, returnsRef bool, params []node.Node, returnType node.Node, stmts []node.Node, phpDocComment string) node.Node { return Function{ - "Function", map[string]interface{}{ "returnsRef": returnsRef, "phpDocComment": phpDocComment, @@ -29,10 +27,6 @@ func NewFunction(functionName node.Node, returnsRef bool, params []node.Node, re } } -func (n Function) Name() string { - return "Function" -} - func (n Function) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/global.go b/node/stmt/global.go index 8afb7e2..a22c606 100644 --- a/node/stmt/global.go +++ b/node/stmt/global.go @@ -5,7 +5,6 @@ import ( ) type Global struct { - name string attributes map[string]interface{} position *node.Position vars []node.Node @@ -13,17 +12,12 @@ type Global struct { func NewGlobal(vars []node.Node) node.Node { return Global{ - "Global", map[string]interface{}{}, nil, vars, } } -func (n Global) Name() string { - return "Global" -} - func (n Global) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/goto.go b/node/stmt/goto.go index 4ebf71a..61dadb2 100644 --- a/node/stmt/goto.go +++ b/node/stmt/goto.go @@ -5,7 +5,6 @@ import ( ) type Goto struct { - name string attributes map[string]interface{} position *node.Position label node.Node @@ -13,17 +12,12 @@ type Goto struct { func NewGoto(label node.Node) node.Node { return Goto{ - "Goto", map[string]interface{}{}, nil, label, } } -func (n Goto) Name() string { - return "Goto" -} - func (n Goto) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/group_use.go b/node/stmt/group_use.go index e58c168..57dc840 100644 --- a/node/stmt/group_use.go +++ b/node/stmt/group_use.go @@ -5,7 +5,6 @@ import ( ) type GroupUse struct { - name string attributes map[string]interface{} position *node.Position useType node.Node @@ -15,7 +14,6 @@ type GroupUse struct { func NewGroupUse(useType node.Node, prefix node.Node, useList []node.Node) node.Node { return GroupUse{ - "GroupUse", map[string]interface{}{}, nil, useType, @@ -24,10 +22,6 @@ func NewGroupUse(useType node.Node, prefix node.Node, useList []node.Node) node. } } -func (n GroupUse) Name() string { - return "GroupUse" -} - func (n GroupUse) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/halt_compiler.go b/node/stmt/halt_compiler.go index d3df311..2984d8f 100644 --- a/node/stmt/halt_compiler.go +++ b/node/stmt/halt_compiler.go @@ -5,23 +5,17 @@ import ( ) type HaltCompiler struct { - name string attributes map[string]interface{} position *node.Position } func NewHaltCompiler() node.Node { return HaltCompiler{ - "HaltCompiler", map[string]interface{}{}, nil, } } -func (n HaltCompiler) Name() string { - return "HaltCompiler" -} - func (n HaltCompiler) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/if.go b/node/stmt/if.go index a538b29..e3964cb 100644 --- a/node/stmt/if.go +++ b/node/stmt/if.go @@ -5,7 +5,6 @@ import ( ) type If struct { - name string attributes map[string]interface{} position *node.Position cond node.Node @@ -16,7 +15,6 @@ type If struct { func NewIf(cond node.Node, stmt node.Node) node.Node { return If{ - "If", map[string]interface{}{}, nil, cond, @@ -26,10 +24,6 @@ func NewIf(cond node.Node, stmt node.Node) node.Node { } } -func (n If) Name() string { - return "If" -} - func (n If) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/inline_html.go b/node/stmt/inline_html.go index 5272c29..8a0cfab 100644 --- a/node/stmt/inline_html.go +++ b/node/stmt/inline_html.go @@ -5,14 +5,12 @@ import ( ) type InlineHtml struct { - name string attributes map[string]interface{} position *node.Position } func NewInlineHtml(value string) node.Node { return InlineHtml{ - "InlineHtml", map[string]interface{}{ "value": value, }, @@ -20,10 +18,6 @@ func NewInlineHtml(value string) node.Node { } } -func (n InlineHtml) Name() string { - return "InlineHtml" -} - func (n InlineHtml) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/interface.go b/node/stmt/interface.go index b88086c..1463eb3 100644 --- a/node/stmt/interface.go +++ b/node/stmt/interface.go @@ -5,7 +5,6 @@ import ( ) type Interface struct { - name string attributes map[string]interface{} position *node.Position interfaceName node.Node @@ -15,7 +14,6 @@ type Interface struct { func NewInterface(interfaceName node.Node, extends []node.Node, stmts []node.Node, phpDocComment string) node.Node { return Interface{ - "Interface", map[string]interface{}{ "phpDocComment": phpDocComment, }, @@ -26,10 +24,6 @@ func NewInterface(interfaceName node.Node, extends []node.Node, stmts []node.Nod } } -func (n Interface) Name() string { - return "Interface" -} - func (n Interface) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/label.go b/node/stmt/label.go index 8e979fa..23415ee 100644 --- a/node/stmt/label.go +++ b/node/stmt/label.go @@ -5,7 +5,6 @@ import ( ) type Label struct { - name string attributes map[string]interface{} position *node.Position labelName node.Node @@ -13,17 +12,12 @@ type Label struct { func NewLabel(labelName node.Node) node.Node { return Label{ - "Label", map[string]interface{}{}, nil, labelName, } } -func (n Label) Name() string { - return "Label" -} - func (n Label) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/namespace.go b/node/stmt/namespace.go index 920dd2e..fc98132 100644 --- a/node/stmt/namespace.go +++ b/node/stmt/namespace.go @@ -5,7 +5,6 @@ import ( ) type Namespace struct { - name string attributes map[string]interface{} position *node.Position namespaceName node.Node @@ -14,7 +13,6 @@ type Namespace struct { func NewNamespace(namespaceName node.Node, stmts []node.Node) node.Node { return Namespace{ - "Namespace", map[string]interface{}{}, nil, namespaceName, @@ -22,10 +20,6 @@ func NewNamespace(namespaceName node.Node, stmts []node.Node) node.Node { } } -func (n Namespace) Name() string { - return "Namespace" -} - func (n Namespace) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/nop.go b/node/stmt/nop.go index e6cca21..981ea24 100644 --- a/node/stmt/nop.go +++ b/node/stmt/nop.go @@ -5,23 +5,17 @@ import ( ) type Nop struct { - name string attributes map[string]interface{} position *node.Position } func NewNop() node.Node { return Nop{ - "Nop", map[string]interface{}{}, nil, } } -func (n Nop) Name() string { - return "Nop" -} - func (n Nop) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/property.go b/node/stmt/property.go index 926ae62..fdb22ba 100644 --- a/node/stmt/property.go +++ b/node/stmt/property.go @@ -5,7 +5,6 @@ import ( ) type Property struct { - name string attributes map[string]interface{} position *node.Position variable node.Node @@ -14,7 +13,6 @@ type Property struct { func NewProperty(variable node.Node, expr node.Node, phpDocComment string) node.Node { return Property{ - "Property", map[string]interface{}{ "phpDocComment": phpDocComment, }, @@ -23,10 +21,6 @@ func NewProperty(variable node.Node, expr node.Node, phpDocComment string) node. expr, } } -func (n Property) Name() string { - return "Property" -} - func (n Property) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/property_list.go b/node/stmt/property_list.go index f73783a..50a62a8 100644 --- a/node/stmt/property_list.go +++ b/node/stmt/property_list.go @@ -5,7 +5,6 @@ import ( ) type PropertyList struct { - name string attributes map[string]interface{} position *node.Position modifiers []node.Node @@ -14,7 +13,6 @@ type PropertyList struct { func NewPropertyList(modifiers []node.Node, properties []node.Node) node.Node { return PropertyList{ - "PropertyList", map[string]interface{}{}, nil, modifiers, @@ -22,10 +20,6 @@ func NewPropertyList(modifiers []node.Node, properties []node.Node) node.Node { } } -func (n PropertyList) Name() string { - return "PropertyList" -} - func (n PropertyList) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/return.go b/node/stmt/return.go index 907ef58..26eb2b8 100644 --- a/node/stmt/return.go +++ b/node/stmt/return.go @@ -5,7 +5,6 @@ import ( ) type Return struct { - name string attributes map[string]interface{} position *node.Position expr node.Node @@ -13,17 +12,12 @@ type Return struct { func NewReturn(expr node.Node) node.Node { return Return{ - "Return", map[string]interface{}{}, nil, expr, } } -func (n Return) Name() string { - return "Return" -} - func (n Return) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/static.go b/node/stmt/static.go index f1a4292..121d72e 100644 --- a/node/stmt/static.go +++ b/node/stmt/static.go @@ -5,7 +5,6 @@ import ( ) type Static struct { - name string attributes map[string]interface{} position *node.Position vars []node.Node @@ -13,17 +12,12 @@ type Static struct { func NewStatic(vars []node.Node) node.Node { return Static{ - "Static", map[string]interface{}{}, nil, vars, } } -func (n Static) Name() string { - return "Static" -} - func (n Static) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/static_var.go b/node/stmt/static_var.go index c319f99..b8782b0 100644 --- a/node/stmt/static_var.go +++ b/node/stmt/static_var.go @@ -5,7 +5,6 @@ import ( ) type StaticVar struct { - name string attributes map[string]interface{} position *node.Position variable node.Node @@ -14,7 +13,6 @@ type StaticVar struct { func NewStaticVar(variable node.Node, expr node.Node) node.Node { return StaticVar{ - "StaticVar", map[string]interface{}{}, nil, variable, @@ -22,10 +20,6 @@ func NewStaticVar(variable node.Node, expr node.Node) node.Node { } } -func (n StaticVar) Name() string { - return "StaticVar" -} - func (n StaticVar) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/stmt_list.go b/node/stmt/stmt_list.go index d257fe2..e70a2b8 100644 --- a/node/stmt/stmt_list.go +++ b/node/stmt/stmt_list.go @@ -5,7 +5,6 @@ import ( ) type StmtList struct { - name string attributes map[string]interface{} position *node.Position stmts []node.Node @@ -13,17 +12,12 @@ type StmtList struct { func NewStmtList(stmts []node.Node) node.Node { return StmtList{ - "StmtList", map[string]interface{}{}, nil, stmts, } } -func (n StmtList) Name() string { - return "StmtList" -} - func (n StmtList) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/switch.go b/node/stmt/switch.go index 70eb4e2..d1550c1 100644 --- a/node/stmt/switch.go +++ b/node/stmt/switch.go @@ -6,7 +6,6 @@ import ( ) type Switch struct { - name string attributes map[string]interface{} position *node.Position token token.Token @@ -16,7 +15,6 @@ type Switch struct { func NewSwitch(token token.Token, cond node.Node, cases []node.Node) node.Node { return Switch{ - "Switch", map[string]interface{}{}, nil, token, @@ -25,10 +23,6 @@ func NewSwitch(token token.Token, cond node.Node, cases []node.Node) node.Node { } } -func (n Switch) Name() string { - return "Switch" -} - func (n Switch) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/throw.go b/node/stmt/throw.go index d4d3213..1200a59 100644 --- a/node/stmt/throw.go +++ b/node/stmt/throw.go @@ -5,7 +5,6 @@ import ( ) type Throw struct { - name string attributes map[string]interface{} position *node.Position expr node.Node @@ -13,17 +12,12 @@ type Throw struct { func NewThrow(expr node.Node) node.Node { return Throw{ - "Throw", map[string]interface{}{}, nil, expr, } } -func (n Throw) Name() string { - return "Throw" -} - func (n Throw) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/trait.go b/node/stmt/trait.go index fcdef61..e42e877 100644 --- a/node/stmt/trait.go +++ b/node/stmt/trait.go @@ -5,7 +5,6 @@ import ( ) type Trait struct { - name string attributes map[string]interface{} position *node.Position traitName node.Node @@ -14,7 +13,6 @@ type Trait struct { func NewTrait(traitName node.Node, stmts []node.Node, phpDocComment string) node.Node { return Trait{ - "Trait", map[string]interface{}{ "phpDocComment": phpDocComment, }, @@ -24,10 +22,6 @@ func NewTrait(traitName node.Node, stmts []node.Node, phpDocComment string) node } } -func (n Trait) Name() string { - return "Trait" -} - func (n Trait) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/trait_method_ref.go b/node/stmt/trait_method_ref.go index 7a14e89..ba27b1a 100644 --- a/node/stmt/trait_method_ref.go +++ b/node/stmt/trait_method_ref.go @@ -5,7 +5,6 @@ import ( ) type TraitMethodRef struct { - name string attributes map[string]interface{} position *node.Position trait node.Node @@ -14,7 +13,6 @@ type TraitMethodRef struct { func NewTraitMethodRef(trait node.Node, method node.Node) node.Node { return TraitMethodRef{ - "TraitMethodRef", map[string]interface{}{}, nil, trait, @@ -22,10 +20,6 @@ func NewTraitMethodRef(trait node.Node, method node.Node) node.Node { } } -func (n TraitMethodRef) Name() string { - return "TraitMethodRef" -} - func (n TraitMethodRef) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/trait_use.go b/node/stmt/trait_use.go index 3171ce5..07821f8 100644 --- a/node/stmt/trait_use.go +++ b/node/stmt/trait_use.go @@ -5,7 +5,6 @@ import ( ) type TraitUse struct { - name string attributes map[string]interface{} position *node.Position traits []node.Node @@ -14,7 +13,6 @@ type TraitUse struct { func NewTraitUse(traits []node.Node, adaptations []node.Node) node.Node { return TraitUse{ - "TraitUse", map[string]interface{}{}, nil, traits, @@ -22,10 +20,6 @@ func NewTraitUse(traits []node.Node, adaptations []node.Node) node.Node { } } -func (n TraitUse) Name() string { - return "TraitUse" -} - func (n TraitUse) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/trait_use_alias.go b/node/stmt/trait_use_alias.go index 03a866b..b0aa2da 100644 --- a/node/stmt/trait_use_alias.go +++ b/node/stmt/trait_use_alias.go @@ -5,7 +5,6 @@ import ( ) type TraitUseAlias struct { - name string attributes map[string]interface{} position *node.Position ref node.Node @@ -15,7 +14,6 @@ type TraitUseAlias struct { func NewTraitUseAlias(ref node.Node, modifier node.Node, alias node.Node) node.Node { return TraitUseAlias{ - "TraitUseAlias", map[string]interface{}{}, nil, ref, @@ -24,10 +22,6 @@ func NewTraitUseAlias(ref node.Node, modifier node.Node, alias node.Node) node.N } } -func (n TraitUseAlias) Name() string { - return "TraitUseAlias" -} - func (n TraitUseAlias) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/trait_use_precedence.go b/node/stmt/trait_use_precedence.go index 25e01fe..d04cdc6 100644 --- a/node/stmt/trait_use_precedence.go +++ b/node/stmt/trait_use_precedence.go @@ -5,7 +5,6 @@ import ( ) type TraitUsePrecedence struct { - name string attributes map[string]interface{} position *node.Position ref node.Node @@ -14,7 +13,6 @@ type TraitUsePrecedence struct { func NewTraitUsePrecedence(ref node.Node, insteadof node.Node) node.Node { return TraitUsePrecedence{ - "TraitUsePrecedence", map[string]interface{}{}, nil, ref, @@ -22,10 +20,6 @@ func NewTraitUsePrecedence(ref node.Node, insteadof node.Node) node.Node { } } -func (n TraitUsePrecedence) Name() string { - return "TraitUsePrecedence" -} - func (n TraitUsePrecedence) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/try.go b/node/stmt/try.go index c2b36b8..f16e6b7 100644 --- a/node/stmt/try.go +++ b/node/stmt/try.go @@ -5,7 +5,6 @@ import ( ) type Try struct { - name string attributes map[string]interface{} position *node.Position stmts []node.Node @@ -15,7 +14,6 @@ type Try struct { func NewTry(stmts []node.Node, catches []node.Node, finally node.Node) node.Node { return Try{ - "Try", map[string]interface{}{}, nil, stmts, @@ -24,10 +22,6 @@ func NewTry(stmts []node.Node, catches []node.Node, finally node.Node) node.Node } } -func (n Try) Name() string { - return "Try" -} - func (n Try) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/unset.go b/node/stmt/unset.go index fc20a48..d7fcadb 100644 --- a/node/stmt/unset.go +++ b/node/stmt/unset.go @@ -5,7 +5,6 @@ import ( ) type Unset struct { - name string attributes map[string]interface{} position *node.Position vars []node.Node @@ -13,17 +12,12 @@ type Unset struct { func NewUnset(vars []node.Node) node.Node { return Unset{ - "Unset", map[string]interface{}{}, nil, vars, } } -func (n Unset) Name() string { - return "Unset" -} - func (n Unset) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/use.go b/node/stmt/use.go index 913db2b..4f77a6a 100644 --- a/node/stmt/use.go +++ b/node/stmt/use.go @@ -5,7 +5,6 @@ import ( ) type Use struct { - name string attributes map[string]interface{} position *node.Position useType node.Node @@ -15,7 +14,6 @@ type Use struct { func NewUse(useType node.Node, use node.Node, alias node.Node) node.Node { return Use{ - "Use", map[string]interface{}{}, nil, useType, @@ -24,10 +22,6 @@ func NewUse(useType node.Node, use node.Node, alias node.Node) node.Node { } } -func (n Use) Name() string { - return "Use" -} - func (n Use) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/use_list.go b/node/stmt/use_list.go index 02e0f02..72e9f30 100644 --- a/node/stmt/use_list.go +++ b/node/stmt/use_list.go @@ -5,7 +5,6 @@ import ( ) type UseList struct { - name string attributes map[string]interface{} position *node.Position useType node.Node @@ -14,7 +13,6 @@ type UseList struct { func NewUseList(useType node.Node, uses []node.Node) node.Node { return UseList{ - "UseList", map[string]interface{}{}, nil, useType, @@ -22,10 +20,6 @@ func NewUseList(useType node.Node, uses []node.Node) node.Node { } } -func (n UseList) Name() string { - return "UseList" -} - func (n UseList) Attributes() map[string]interface{} { return n.attributes } diff --git a/node/stmt/while.go b/node/stmt/while.go index 9181d9d..312a831 100644 --- a/node/stmt/while.go +++ b/node/stmt/while.go @@ -6,7 +6,6 @@ import ( ) type While struct { - name string attributes map[string]interface{} position *node.Position token token.Token @@ -16,7 +15,6 @@ type While struct { func NewWhile(token token.Token, cond node.Node, stmt node.Node) node.Node { return While{ - "While", map[string]interface{}{}, nil, token, @@ -25,10 +23,6 @@ func NewWhile(token token.Token, cond node.Node, stmt node.Node) node.Node { } } -func (n While) Name() string { - return "While" -} - func (n While) Attributes() map[string]interface{} { return n.attributes }