remove unused attributes fields

This commit is contained in:
z7zmey 2018-01-05 00:12:01 +02:00
parent 469db8f9e2
commit 17bca8d1dc
156 changed files with 739 additions and 996 deletions

View File

@ -1,34 +1,23 @@
package node
type Argument struct {
attributes map[string]interface{}
position *Position
expr Node
variadic bool
position *Position
Variadic bool
Expr Node
}
func NewArgument(Expression Node, variadic bool) Node {
func NewArgument(Expression Node, Variadic bool) Node {
return &Argument{
map[string]interface{}{
"variadic": variadic,
},
nil,
Variadic,
Expression,
variadic,
}
}
func (n Argument) Attributes() map[string]interface{} {
return n.attributes
}
func (n Argument) Attribute(Key string) interface{} {
return n.attributes[Key]
}
func (n Argument) SetAttribute(Key string, Value interface{}) Node {
n.attributes[Key] = Value
return n
return map[string]interface{}{
"Variadic": n.Variadic,
}
}
func (n Argument) Position() *Position {
@ -45,9 +34,9 @@ func (n Argument) Walk(v Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -5,21 +5,19 @@ import (
)
type Array struct {
attributes map[string]interface{}
position *node.Position
Items []node.Node
position *node.Position
Items []node.Node
}
func NewArray(Items []node.Node) node.Node {
return &Array{
map[string]interface{}{},
nil,
Items,
}
}
func (n Array) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Array) Position() *node.Position {

View File

@ -5,15 +5,13 @@ import (
)
type ArrayDimFetch struct {
attributes map[string]interface{}
position *node.Position
Variable node.Node
Dim node.Node
position *node.Position
Variable node.Node
Dim node.Node
}
func NewArrayDimFetch(Variable node.Node, Dim node.Node) node.Node {
return &ArrayDimFetch{
map[string]interface{}{},
nil,
Variable,
Dim,
@ -21,7 +19,7 @@ func NewArrayDimFetch(Variable node.Node, Dim node.Node) node.Node {
}
func (n ArrayDimFetch) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n ArrayDimFetch) Position() *node.Position {

View File

@ -5,25 +5,25 @@ import (
)
type ArrayItem struct {
attributes map[string]interface{}
position *node.Position
Key node.Node
Val node.Node
position *node.Position
ByRef bool
Key node.Node
Val node.Node
}
func NewArrayItem(Key node.Node, Val node.Node, byRef bool) node.Node {
func NewArrayItem(Key node.Node, Val node.Node, ByRef bool) node.Node {
return &ArrayItem{
map[string]interface{}{
"byRef": byRef,
},
nil,
ByRef,
Key,
Val,
}
}
func (n ArrayItem) Attributes() map[string]interface{} {
return n.attributes
return map[string]interface{}{
"ByRef": n.ByRef,
}
}
func (n ArrayItem) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type Assign struct {
func NewAssign(Variable node.Node, Expression node.Node) node.Node {
return &Assign{
AssignOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewAssign(Variable node.Node, Expression node.Node) node.Node {
}
func (n Assign) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Assign) Position() *node.Position {

View File

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

View File

@ -11,7 +11,6 @@ type AssignRef struct {
func NewAssignRef(Variable node.Node, Expression node.Node) node.Node {
return &AssignRef{
AssignOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewAssignRef(Variable node.Node, Expression node.Node) node.Node {
}
func (n AssignRef) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n AssignRef) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type BitwiseAnd struct {
func NewBitwiseAnd(Variable node.Node, Expression node.Node) node.Node {
return &BitwiseAnd{
AssignOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewBitwiseAnd(Variable node.Node, Expression node.Node) node.Node {
}
func (n BitwiseAnd) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n BitwiseAnd) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type BitwiseOr struct {
func NewBitwiseOr(Variable node.Node, Expression node.Node) node.Node {
return &BitwiseOr{
AssignOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewBitwiseOr(Variable node.Node, Expression node.Node) node.Node {
}
func (n BitwiseOr) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n BitwiseOr) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type BitwiseXor struct {
func NewBitwiseXor(Variable node.Node, Expression node.Node) node.Node {
return &BitwiseXor{
AssignOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewBitwiseXor(Variable node.Node, Expression node.Node) node.Node {
}
func (n BitwiseXor) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n BitwiseXor) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type Concat struct {
func NewConcat(Variable node.Node, Expression node.Node) node.Node {
return &Concat{
AssignOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewConcat(Variable node.Node, Expression node.Node) node.Node {
}
func (n Concat) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Concat) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type Div struct {
func NewDiv(Variable node.Node, Expression node.Node) node.Node {
return &Div{
AssignOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewDiv(Variable node.Node, Expression node.Node) node.Node {
}
func (n Div) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Div) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type Minus struct {
func NewMinus(Variable node.Node, Expression node.Node) node.Node {
return &Minus{
AssignOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewMinus(Variable node.Node, Expression node.Node) node.Node {
}
func (n Minus) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Minus) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type Mod struct {
func NewMod(Variable node.Node, Expression node.Node) node.Node {
return &Mod{
AssignOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewMod(Variable node.Node, Expression node.Node) node.Node {
}
func (n Mod) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Mod) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type Mul struct {
func NewMul(Variable node.Node, Expression node.Node) node.Node {
return &Mul{
AssignOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewMul(Variable node.Node, Expression node.Node) node.Node {
}
func (n Mul) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Mul) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type Plus struct {
func NewPlus(Variable node.Node, Expression node.Node) node.Node {
return &Plus{
AssignOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewPlus(Variable node.Node, Expression node.Node) node.Node {
}
func (n Plus) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Plus) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type Pow struct {
func NewPow(Variable node.Node, Expression node.Node) node.Node {
return &Pow{
AssignOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewPow(Variable node.Node, Expression node.Node) node.Node {
}
func (n Pow) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Pow) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type ShiftLeft struct {
func NewShiftLeft(Variable node.Node, Expression node.Node) node.Node {
return &ShiftLeft{
AssignOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewShiftLeft(Variable node.Node, Expression node.Node) node.Node {
}
func (n ShiftLeft) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n ShiftLeft) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type ShiftRight struct {
func NewShiftRight(Variable node.Node, Expression node.Node) node.Node {
return &ShiftRight{
AssignOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewShiftRight(Variable node.Node, Expression node.Node) node.Node {
}
func (n ShiftRight) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n ShiftRight) Position() *node.Position {

View File

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

View File

@ -11,7 +11,6 @@ type BitwiseAnd struct {
func NewBitwiseAnd(Variable node.Node, Expression node.Node) node.Node {
return &BitwiseAnd{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewBitwiseAnd(Variable node.Node, Expression node.Node) node.Node {
}
func (n BitwiseAnd) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n BitwiseAnd) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type BitwiseOr struct {
func NewBitwiseOr(Variable node.Node, Expression node.Node) node.Node {
return &BitwiseOr{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewBitwiseOr(Variable node.Node, Expression node.Node) node.Node {
}
func (n BitwiseOr) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n BitwiseOr) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type BitwiseXor struct {
func NewBitwiseXor(Variable node.Node, Expression node.Node) node.Node {
return &BitwiseXor{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewBitwiseXor(Variable node.Node, Expression node.Node) node.Node {
}
func (n BitwiseXor) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n BitwiseXor) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type BooleanAnd struct {
func NewBooleanAnd(Variable node.Node, Expression node.Node) node.Node {
return &BooleanAnd{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewBooleanAnd(Variable node.Node, Expression node.Node) node.Node {
}
func (n BooleanAnd) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n BooleanAnd) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type BooleanOr struct {
func NewBooleanOr(Variable node.Node, Expression node.Node) node.Node {
return &BooleanOr{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewBooleanOr(Variable node.Node, Expression node.Node) node.Node {
}
func (n BooleanOr) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n BooleanOr) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type Coalesce struct {
func NewCoalesce(Variable node.Node, Expression node.Node) node.Node {
return &Coalesce{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewCoalesce(Variable node.Node, Expression node.Node) node.Node {
}
func (n Coalesce) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Coalesce) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type Concat struct {
func NewConcat(Variable node.Node, Expression node.Node) node.Node {
return &Concat{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewConcat(Variable node.Node, Expression node.Node) node.Node {
}
func (n Concat) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Concat) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type Div struct {
func NewDiv(Variable node.Node, Expression node.Node) node.Node {
return &Div{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewDiv(Variable node.Node, Expression node.Node) node.Node {
}
func (n Div) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Div) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type Equal struct {
func NewEqual(Variable node.Node, Expression node.Node) node.Node {
return &Equal{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewEqual(Variable node.Node, Expression node.Node) node.Node {
}
func (n Equal) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Equal) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type Greater struct {
func NewGreater(Variable node.Node, Expression node.Node) node.Node {
return &Greater{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewGreater(Variable node.Node, Expression node.Node) node.Node {
}
func (n Greater) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Greater) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type GreaterOrEqual struct {
func NewGreaterOrEqual(Variable node.Node, Expression node.Node) node.Node {
return &GreaterOrEqual{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewGreaterOrEqual(Variable node.Node, Expression node.Node) node.Node {
}
func (n GreaterOrEqual) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n GreaterOrEqual) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type Identical struct {
func NewIdentical(Variable node.Node, Expression node.Node) node.Node {
return &Identical{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewIdentical(Variable node.Node, Expression node.Node) node.Node {
}
func (n Identical) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Identical) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type LogicalAnd struct {
func NewLogicalAnd(Variable node.Node, Expression node.Node) node.Node {
return &LogicalAnd{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewLogicalAnd(Variable node.Node, Expression node.Node) node.Node {
}
func (n LogicalAnd) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n LogicalAnd) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type LogicalOr struct {
func NewLogicalOr(Variable node.Node, Expression node.Node) node.Node {
return &LogicalOr{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewLogicalOr(Variable node.Node, Expression node.Node) node.Node {
}
func (n LogicalOr) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n LogicalOr) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type LogicalXor struct {
func NewLogicalXor(Variable node.Node, Expression node.Node) node.Node {
return &LogicalXor{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewLogicalXor(Variable node.Node, Expression node.Node) node.Node {
}
func (n LogicalXor) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n LogicalXor) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type Minus struct {
func NewMinus(Variable node.Node, Expression node.Node) node.Node {
return &Minus{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewMinus(Variable node.Node, Expression node.Node) node.Node {
}
func (n Minus) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Minus) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type Mod struct {
func NewMod(Variable node.Node, Expression node.Node) node.Node {
return &Mod{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewMod(Variable node.Node, Expression node.Node) node.Node {
}
func (n Mod) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Mod) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type Mul struct {
func NewMul(Variable node.Node, Expression node.Node) node.Node {
return &Mul{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewMul(Variable node.Node, Expression node.Node) node.Node {
}
func (n Mul) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Mul) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type NotEqual struct {
func NewNotEqual(Variable node.Node, Expression node.Node) node.Node {
return &NotEqual{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewNotEqual(Variable node.Node, Expression node.Node) node.Node {
}
func (n NotEqual) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n NotEqual) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type NotIdentical struct {
func NewNotIdentical(Variable node.Node, Expression node.Node) node.Node {
return &NotIdentical{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewNotIdentical(Variable node.Node, Expression node.Node) node.Node {
}
func (n NotIdentical) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n NotIdentical) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type Plus struct {
func NewPlus(Variable node.Node, Expression node.Node) node.Node {
return &Plus{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewPlus(Variable node.Node, Expression node.Node) node.Node {
}
func (n Plus) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Plus) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type Pow struct {
func NewPow(Variable node.Node, Expression node.Node) node.Node {
return &Pow{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewPow(Variable node.Node, Expression node.Node) node.Node {
}
func (n Pow) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Pow) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type ShiftLeft struct {
func NewShiftLeft(Variable node.Node, Expression node.Node) node.Node {
return &ShiftLeft{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewShiftLeft(Variable node.Node, Expression node.Node) node.Node {
}
func (n ShiftLeft) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n ShiftLeft) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type ShiftRight struct {
func NewShiftRight(Variable node.Node, Expression node.Node) node.Node {
return &ShiftRight{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewShiftRight(Variable node.Node, Expression node.Node) node.Node {
}
func (n ShiftRight) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n ShiftRight) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type Smaller struct {
func NewSmaller(Variable node.Node, Expression node.Node) node.Node {
return &Smaller{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewSmaller(Variable node.Node, Expression node.Node) node.Node {
}
func (n Smaller) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Smaller) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type SmallerOrEqual struct {
func NewSmallerOrEqual(Variable node.Node, Expression node.Node) node.Node {
return &SmallerOrEqual{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewSmallerOrEqual(Variable node.Node, Expression node.Node) node.Node {
}
func (n SmallerOrEqual) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n SmallerOrEqual) Position() *node.Position {

View File

@ -11,7 +11,6 @@ type Spaceship struct {
func NewSpaceship(Variable node.Node, Expression node.Node) node.Node {
return &Spaceship{
BinaryOp{
map[string]interface{}{},
nil,
Variable,
Expression,
@ -20,7 +19,7 @@ func NewSpaceship(Variable node.Node, Expression node.Node) node.Node {
}
func (n Spaceship) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Spaceship) Position() *node.Position {

View File

@ -5,21 +5,19 @@ import (
)
type BitwiseNot struct {
attributes map[string]interface{}
position *node.Position
expr node.Node
position *node.Position
Expr node.Node
}
func NewBitwiseNot(Expression node.Node) node.Node {
return &BitwiseNot{
map[string]interface{}{},
nil,
Expression,
}
}
func (n BitwiseNot) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n BitwiseNot) Position() *node.Position {
@ -36,9 +34,9 @@ func (n BitwiseNot) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -5,21 +5,19 @@ import (
)
type BooleanNot struct {
attributes map[string]interface{}
position *node.Position
expr node.Node
position *node.Position
Expr node.Node
}
func NewBooleanNot(Expression node.Node) node.Node {
return &BooleanNot{
map[string]interface{}{},
nil,
Expression,
}
}
func (n BooleanNot) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n BooleanNot) Position() *node.Position {
@ -36,9 +34,9 @@ func (n BooleanNot) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

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

View File

@ -8,18 +8,17 @@ type CastArray struct {
Cast
}
func NewCastArray(expr node.Node) node.Node {
func NewCastArray(Expr node.Node) node.Node {
return &CastArray{
Cast{
map[string]interface{}{},
nil,
expr,
Expr,
},
}
}
func (n CastArray) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n CastArray) Position() *node.Position {
@ -36,9 +35,9 @@ func (n CastArray) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -8,18 +8,17 @@ type CastBool struct {
Cast
}
func NewCastBool(expr node.Node) node.Node {
func NewCastBool(Expr node.Node) node.Node {
return &CastBool{
Cast{
map[string]interface{}{},
nil,
expr,
Expr,
},
}
}
func (n CastBool) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n CastBool) Position() *node.Position {
@ -36,9 +35,9 @@ func (n CastBool) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -8,18 +8,17 @@ type CastDouble struct {
Cast
}
func NewCastDouble(expr node.Node) node.Node {
func NewCastDouble(Expr node.Node) node.Node {
return &CastDouble{
Cast{
map[string]interface{}{},
nil,
expr,
Expr,
},
}
}
func (n CastDouble) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n CastDouble) Position() *node.Position {
@ -36,9 +35,9 @@ func (n CastDouble) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -8,18 +8,17 @@ type CastInt struct {
Cast
}
func NewCastInt(expr node.Node) node.Node {
func NewCastInt(Expr node.Node) node.Node {
return &CastInt{
Cast{
map[string]interface{}{},
nil,
expr,
Expr,
},
}
}
func (n CastInt) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n CastInt) Position() *node.Position {
@ -36,9 +35,9 @@ func (n CastInt) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -8,18 +8,17 @@ type CastObject struct {
Cast
}
func NewCastObject(expr node.Node) node.Node {
func NewCastObject(Expr node.Node) node.Node {
return &CastObject{
Cast{
map[string]interface{}{},
nil,
expr,
Expr,
},
}
}
func (n CastObject) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n CastObject) Position() *node.Position {
@ -36,9 +35,9 @@ func (n CastObject) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -8,18 +8,17 @@ type CastString struct {
Cast
}
func NewCastString(expr node.Node) node.Node {
func NewCastString(Expr node.Node) node.Node {
return &CastString{
Cast{
map[string]interface{}{},
nil,
expr,
Expr,
},
}
}
func (n CastString) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n CastString) Position() *node.Position {
@ -36,9 +35,9 @@ func (n CastString) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -8,18 +8,17 @@ type CastUnset struct {
Cast
}
func NewCastUnset(expr node.Node) node.Node {
func NewCastUnset(Expr node.Node) node.Node {
return &CastUnset{
Cast{
map[string]interface{}{},
nil,
expr,
Expr,
},
}
}
func (n CastUnset) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n CastUnset) Position() *node.Position {
@ -36,9 +35,9 @@ func (n CastUnset) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -5,7 +5,6 @@ import (
)
type ClassConstFetch struct {
attributes map[string]interface{}
position *node.Position
Class node.Node
ConstantName node.Node
@ -13,7 +12,6 @@ type ClassConstFetch struct {
func NewClassConstFetch(Class node.Node, ConstantName node.Node) node.Node {
return &ClassConstFetch{
map[string]interface{}{},
nil,
Class,
ConstantName,
@ -21,7 +19,7 @@ func NewClassConstFetch(Class node.Node, ConstantName node.Node) node.Node {
}
func (n ClassConstFetch) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n ClassConstFetch) Position() *node.Position {

View File

@ -5,21 +5,19 @@ import (
)
type Clone struct {
attributes map[string]interface{}
position *node.Position
expr node.Node
position *node.Position
Expr node.Node
}
func NewClone(Expression node.Node) node.Node {
return &Clone{
map[string]interface{}{},
nil,
Expression,
}
}
func (n Clone) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Clone) Position() *node.Position {
@ -36,9 +34,9 @@ func (n Clone) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -5,22 +5,22 @@ import (
)
type Closure struct {
attributes map[string]interface{}
position *node.Position
Params []node.Node
Uses []node.Node
ReturnType node.Node
Stmts []node.Node
position *node.Position
ReturnsRef bool
Static bool
PhpDocComment string
Params []node.Node
Uses []node.Node
ReturnType node.Node
Stmts []node.Node
}
func NewClosure(Params []node.Node, Uses []node.Node, ReturnType node.Node, Stmts []node.Node, isStatic bool, isReturnRef bool, phpDocComment string) node.Node {
func NewClosure(Params []node.Node, Uses []node.Node, ReturnType node.Node, Stmts []node.Node, Static bool, ReturnsRef bool, PhpDocComment string) node.Node {
return &Closure{
map[string]interface{}{
"isReturnRef": isReturnRef,
"isStatic": isStatic,
"phpDocComment": phpDocComment,
},
nil,
ReturnsRef,
Static,
PhpDocComment,
Params,
Uses,
ReturnType,
@ -29,7 +29,11 @@ func NewClosure(Params []node.Node, Uses []node.Node, ReturnType node.Node, Stmt
}
func (n Closure) Attributes() map[string]interface{} {
return n.attributes
return map[string]interface{}{
"ReturnsRef": n.ReturnsRef,
"Static": n.Static,
"PhpDocComment": n.PhpDocComment,
}
}
func (n Closure) Position() *node.Position {

View File

@ -5,23 +5,23 @@ import (
)
type ClusureUse struct {
attributes map[string]interface{}
position *node.Position
Variable node.Node
position *node.Position
ByRef bool
Variable node.Node
}
func NewClusureUse(Variable node.Node, byRef bool) node.Node {
func NewClusureUse(Variable node.Node, ByRef bool) node.Node {
return &ClusureUse{
map[string]interface{}{
"byRef": byRef,
},
nil,
ByRef,
Variable,
}
}
func (n ClusureUse) Attributes() map[string]interface{} {
return n.attributes
return map[string]interface{}{
"ByRef": n.ByRef,
}
}
func (n ClusureUse) Position() *node.Position {

View File

@ -5,21 +5,19 @@ import (
)
type ConstFetch struct {
attributes map[string]interface{}
position *node.Position
Constant node.Node
position *node.Position
Constant node.Node
}
func NewConstFetch(Constant node.Node) node.Node {
return &ConstFetch{
map[string]interface{}{},
nil,
Constant,
}
}
func (n ConstFetch) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n ConstFetch) Position() *node.Position {

View File

@ -5,21 +5,19 @@ import (
)
type Empty struct {
attributes map[string]interface{}
position *node.Position
expr node.Node
position *node.Position
Expr node.Node
}
func NewEmpty(Expression node.Node) node.Node {
return &Empty{
map[string]interface{}{},
nil,
Expression,
}
}
func (n Empty) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Empty) Position() *node.Position {
@ -36,9 +34,9 @@ func (n Empty) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -5,21 +5,19 @@ import (
)
type ErrorSuppress struct {
attributes map[string]interface{}
position *node.Position
expr node.Node
position *node.Position
Expr node.Node
}
func NewErrorSuppress(Expression node.Node) node.Node {
return &ErrorSuppress{
map[string]interface{}{},
nil,
Expression,
}
}
func (n ErrorSuppress) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n ErrorSuppress) Position() *node.Position {
@ -36,9 +34,9 @@ func (n ErrorSuppress) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -5,21 +5,19 @@ import (
)
type Eval struct {
attributes map[string]interface{}
position *node.Position
expr node.Node
position *node.Position
Expr node.Node
}
func NewEval(Expression node.Node) node.Node {
return &Eval{
map[string]interface{}{},
nil,
Expression,
}
}
func (n Eval) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Eval) Position() *node.Position {
@ -36,9 +34,9 @@ func (n Eval) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -5,23 +5,23 @@ import (
)
type Exit struct {
attributes map[string]interface{}
position *node.Position
expr node.Node
position *node.Position
Expr node.Node
IsDie bool
}
func NewExit(expr node.Node, isDie bool) node.Node {
func NewExit(Expr node.Node, IsDie bool) node.Node {
return &Exit{
map[string]interface{}{
"isDie": isDie,
},
nil,
expr,
Expr,
IsDie,
}
}
func (n Exit) Attributes() map[string]interface{} {
return n.attributes
return map[string]interface{}{
"IsDie": n.IsDie,
}
}
func (n Exit) Position() *node.Position {
@ -38,9 +38,9 @@ func (n Exit) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -5,15 +5,13 @@ import (
)
type FunctionCall struct {
attributes map[string]interface{}
position *node.Position
Function node.Node
Arguments []node.Node
position *node.Position
Function node.Node
Arguments []node.Node
}
func NewFunctionCall(Function node.Node, Arguments []node.Node) node.Node {
return &FunctionCall{
map[string]interface{}{},
nil,
Function,
Arguments,
@ -21,7 +19,7 @@ func NewFunctionCall(Function node.Node, Arguments []node.Node) node.Node {
}
func (n FunctionCall) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n FunctionCall) Position() *node.Position {

View File

@ -5,21 +5,19 @@ import (
)
type Include struct {
attributes map[string]interface{}
position *node.Position
expr node.Node
position *node.Position
Expr node.Node
}
func NewInclude(Expression node.Node) node.Node {
return &Include{
map[string]interface{}{},
nil,
Expression,
}
}
func (n Include) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Include) Position() *node.Position {
@ -36,9 +34,9 @@ func (n Include) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -5,21 +5,19 @@ import (
)
type IncludeOnce struct {
attributes map[string]interface{}
position *node.Position
expr node.Node
position *node.Position
Expr node.Node
}
func NewIncludeOnce(Expression node.Node) node.Node {
return &IncludeOnce{
map[string]interface{}{},
nil,
Expression,
}
}
func (n IncludeOnce) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n IncludeOnce) Position() *node.Position {
@ -36,9 +34,9 @@ func (n IncludeOnce) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -5,23 +5,21 @@ import (
)
type InstanceOf struct {
attributes map[string]interface{}
position *node.Position
expr node.Node
Class node.Node
position *node.Position
Expr node.Node
Class node.Node
}
func NewInstanceOf(expr node.Node, Class node.Node) node.Node {
func NewInstanceOf(Expr node.Node, Class node.Node) node.Node {
return &InstanceOf{
map[string]interface{}{},
nil,
expr,
Expr,
Class,
}
}
func (n InstanceOf) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n InstanceOf) Position() *node.Position {
@ -38,9 +36,9 @@ func (n InstanceOf) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
if n.Class != nil {

View File

@ -5,21 +5,19 @@ import (
)
type Isset struct {
attributes map[string]interface{}
position *node.Position
Variables []node.Node
position *node.Position
Variables []node.Node
}
func NewIsset(Variables []node.Node) node.Node {
return &Isset{
map[string]interface{}{},
nil,
Variables,
}
}
func (n Isset) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Isset) Position() *node.Position {

View File

@ -5,21 +5,19 @@ import (
)
type List struct {
attributes map[string]interface{}
position *node.Position
Items []node.Node
position *node.Position
Items []node.Node
}
func NewList(Items []node.Node) node.Node {
return &List{
map[string]interface{}{},
nil,
Items,
}
}
func (n List) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n List) Position() *node.Position {

View File

@ -5,16 +5,14 @@ import (
)
type MethodCall struct {
attributes map[string]interface{}
position *node.Position
Variable node.Node
Method node.Node
Arguments []node.Node
position *node.Position
Variable node.Node
Method node.Node
Arguments []node.Node
}
func NewMethodCall(Variable node.Node, Method node.Node, Arguments []node.Node) node.Node {
return &MethodCall{
map[string]interface{}{},
nil,
Variable,
Method,
@ -23,7 +21,7 @@ func NewMethodCall(Variable node.Node, Method node.Node, Arguments []node.Node)
}
func (n MethodCall) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n MethodCall) Position() *node.Position {

View File

@ -5,15 +5,13 @@ import (
)
type New struct {
attributes map[string]interface{}
position *node.Position
Class node.Node
Arguments []node.Node
position *node.Position
Class node.Node
Arguments []node.Node
}
func NewNew(Class node.Node, Arguments []node.Node) node.Node {
return &New{
map[string]interface{}{},
nil,
Class,
Arguments,
@ -21,7 +19,7 @@ func NewNew(Class node.Node, Arguments []node.Node) node.Node {
}
func (n New) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n New) Position() *node.Position {

View File

@ -5,21 +5,19 @@ import (
)
type PostDec struct {
attributes map[string]interface{}
position *node.Position
Variable node.Node
position *node.Position
Variable node.Node
}
func NewPostDec(Variable node.Node) node.Node {
return &PostDec{
map[string]interface{}{},
nil,
Variable,
}
}
func (n PostDec) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n PostDec) Position() *node.Position {

View File

@ -5,21 +5,19 @@ import (
)
type PostInc struct {
attributes map[string]interface{}
position *node.Position
Variable node.Node
position *node.Position
Variable node.Node
}
func NewPostInc(Variable node.Node) node.Node {
return &PostInc{
map[string]interface{}{},
nil,
Variable,
}
}
func (n PostInc) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n PostInc) Position() *node.Position {

View File

@ -5,21 +5,19 @@ import (
)
type PreDec struct {
attributes map[string]interface{}
position *node.Position
Variable node.Node
position *node.Position
Variable node.Node
}
func NewPreDec(Variable node.Node) node.Node {
return &PreDec{
map[string]interface{}{},
nil,
Variable,
}
}
func (n PreDec) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n PreDec) Position() *node.Position {

View File

@ -5,21 +5,19 @@ import (
)
type PreInc struct {
attributes map[string]interface{}
position *node.Position
Variable node.Node
position *node.Position
Variable node.Node
}
func NewPreInc(Variable node.Node) node.Node {
return &PreInc{
map[string]interface{}{},
nil,
Variable,
}
}
func (n PreInc) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n PreInc) Position() *node.Position {

View File

@ -5,21 +5,19 @@ import (
)
type Print struct {
attributes map[string]interface{}
position *node.Position
expr node.Node
position *node.Position
Expr node.Node
}
func NewPrint(Expression node.Node) node.Node {
return &Print{
map[string]interface{}{},
nil,
Expression,
}
}
func (n Print) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Print) Position() *node.Position {
@ -36,9 +34,9 @@ func (n Print) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -5,15 +5,13 @@ import (
)
type PropertyFetch struct {
attributes map[string]interface{}
position *node.Position
Variable node.Node
Property node.Node
position *node.Position
Variable node.Node
Property node.Node
}
func NewPropertyFetch(Variable node.Node, Property node.Node) node.Node {
return &PropertyFetch{
map[string]interface{}{},
nil,
Variable,
Property,
@ -21,7 +19,7 @@ func NewPropertyFetch(Variable node.Node, Property node.Node) node.Node {
}
func (n PropertyFetch) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n PropertyFetch) Position() *node.Position {

View File

@ -5,21 +5,19 @@ import (
)
type Require struct {
attributes map[string]interface{}
position *node.Position
expr node.Node
position *node.Position
Expr node.Node
}
func NewRequire(Expression node.Node) node.Node {
return &Require{
map[string]interface{}{},
nil,
Expression,
}
}
func (n Require) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Require) Position() *node.Position {
@ -36,9 +34,9 @@ func (n Require) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -5,21 +5,19 @@ import (
)
type RequireOnce struct {
attributes map[string]interface{}
position *node.Position
expr node.Node
position *node.Position
Expr node.Node
}
func NewRequireOnce(Expression node.Node) node.Node {
return &RequireOnce{
map[string]interface{}{},
nil,
Expression,
}
}
func (n RequireOnce) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n RequireOnce) Position() *node.Position {
@ -36,9 +34,9 @@ func (n RequireOnce) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -5,21 +5,19 @@ import (
)
type ShellExec struct {
attributes map[string]interface{}
position *node.Position
Parts []node.Node
position *node.Position
Parts []node.Node
}
func NewShellExec(Parts []node.Node) node.Node {
return &ShellExec{
map[string]interface{}{},
nil,
Parts,
}
}
func (n ShellExec) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n ShellExec) Position() *node.Position {

View File

@ -5,21 +5,19 @@ import (
)
type ShortArray struct {
attributes map[string]interface{}
position *node.Position
Items []node.Node
position *node.Position
Items []node.Node
}
func NewShortArray(Items []node.Node) node.Node {
return &ShortArray{
map[string]interface{}{},
nil,
Items,
}
}
func (n ShortArray) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n ShortArray) Position() *node.Position {

View File

@ -5,21 +5,19 @@ import (
)
type ShortList struct {
attributes map[string]interface{}
position *node.Position
Items []node.Node
position *node.Position
Items []node.Node
}
func NewShortList(Items []node.Node) node.Node {
return &ShortList{
map[string]interface{}{},
nil,
Items,
}
}
func (n ShortList) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n ShortList) Position() *node.Position {

View File

@ -5,16 +5,14 @@ import (
)
type StaticCall struct {
attributes map[string]interface{}
position *node.Position
Class node.Node
Call node.Node
Arguments []node.Node
position *node.Position
Class node.Node
Call node.Node
Arguments []node.Node
}
func NewStaticCall(Class node.Node, Call node.Node, Arguments []node.Node) node.Node {
return &StaticCall{
map[string]interface{}{},
nil,
Class,
Call,
@ -23,7 +21,7 @@ func NewStaticCall(Class node.Node, Call node.Node, Arguments []node.Node) node.
}
func (n StaticCall) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n StaticCall) Position() *node.Position {

View File

@ -5,15 +5,13 @@ import (
)
type StaticPropertyFetch struct {
attributes map[string]interface{}
position *node.Position
Class node.Node
Property node.Node
position *node.Position
Class node.Node
Property node.Node
}
func NewStaticPropertyFetch(Class node.Node, Property node.Node) node.Node {
return &StaticPropertyFetch{
map[string]interface{}{},
nil,
Class,
Property,
@ -21,7 +19,7 @@ func NewStaticPropertyFetch(Class node.Node, Property node.Node) node.Node {
}
func (n StaticPropertyFetch) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n StaticPropertyFetch) Position() *node.Position {

View File

@ -5,16 +5,14 @@ import (
)
type Ternary struct {
attributes map[string]interface{}
position *node.Position
Condition node.Node
IfTrue node.Node
IfFalse node.Node
position *node.Position
Condition node.Node
IfTrue node.Node
IfFalse node.Node
}
func NewTernary(Condition node.Node, IfTrue node.Node, IfFalse node.Node) node.Node {
return &Ternary{
map[string]interface{}{},
nil,
Condition,
IfTrue,
@ -23,7 +21,7 @@ func NewTernary(Condition node.Node, IfTrue node.Node, IfFalse node.Node) node.N
}
func (n Ternary) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Ternary) Position() *node.Position {

View File

@ -5,21 +5,19 @@ import (
)
type UnaryMinus struct {
attributes map[string]interface{}
position *node.Position
expr node.Node
position *node.Position
Expr node.Node
}
func NewUnaryMinus(Expression node.Node) node.Node {
return &UnaryMinus{
map[string]interface{}{},
nil,
Expression,
}
}
func (n UnaryMinus) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n UnaryMinus) Position() *node.Position {
@ -36,9 +34,9 @@ func (n UnaryMinus) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -5,21 +5,19 @@ import (
)
type UnaryPlus struct {
attributes map[string]interface{}
position *node.Position
expr node.Node
position *node.Position
Expr node.Node
}
func NewUnaryPlus(Expression node.Node) node.Node {
return &UnaryPlus{
map[string]interface{}{},
nil,
Expression,
}
}
func (n UnaryPlus) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n UnaryPlus) Position() *node.Position {
@ -36,9 +34,9 @@ func (n UnaryPlus) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -5,21 +5,19 @@ import (
)
type Variable struct {
attributes map[string]interface{}
position *node.Position
VarName node.Node
position *node.Position
VarName node.Node
}
func NewVariable(VarName node.Node) node.Node {
return &Variable{
map[string]interface{}{},
nil,
VarName,
}
}
func (n Variable) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Variable) Position() *node.Position {

View File

@ -5,15 +5,13 @@ import (
)
type Yield struct {
attributes map[string]interface{}
position *node.Position
Key node.Node
Value node.Node
position *node.Position
Key node.Node
Value node.Node
}
func NewYield(Key node.Node, Value node.Node) node.Node {
return &Yield{
map[string]interface{}{},
nil,
Key,
Value,
@ -21,7 +19,7 @@ func NewYield(Key node.Node, Value node.Node) node.Node {
}
func (n Yield) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Yield) Position() *node.Position {

View File

@ -5,21 +5,19 @@ import (
)
type YieldFrom struct {
attributes map[string]interface{}
position *node.Position
expr node.Node
position *node.Position
Expr node.Node
}
func NewYieldFrom(Expression node.Node) node.Node {
return &YieldFrom{
map[string]interface{}{},
nil,
Expression,
}
}
func (n YieldFrom) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n YieldFrom) Position() *node.Position {
@ -36,9 +34,9 @@ func (n YieldFrom) Walk(v node.Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -1,34 +1,21 @@
package node
import (
"github.com/z7zmey/php-parser/token"
)
type Identifier struct {
attributes map[string]interface{}
position *Position
position *Position
Value string
}
func NewIdentifier(token token.Token) Node {
func NewIdentifier(Value string) Node {
return &Identifier{
map[string]interface{}{
"Value": token.Value,
},
nil,
Value,
}
}
func (n Identifier) Attributes() map[string]interface{} {
return n.attributes
}
func (n Identifier) Attribute(Key string) interface{} {
return n.attributes[Key]
}
func (n Identifier) SetAttribute(Key string, Value interface{}) Node {
n.attributes[Key] = Value
return n
return map[string]interface{}{
"Value": n.Value,
}
}
func (n Identifier) Position() *Position {

View File

@ -11,13 +11,8 @@ type FullyQualified struct {
func NewFullyQualified(Parts []node.Node) node.Node {
return &FullyQualified{
Name{
map[string]interface{}{},
nil,
Parts,
},
}
}
func (n FullyQualified) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -5,21 +5,19 @@ import (
)
type Name struct {
attributes map[string]interface{}
position *node.Position
Parts []node.Node
position *node.Position
Parts []node.Node
}
func NewName(Parts []node.Node) node.Node {
return &Name{
map[string]interface{}{},
nil,
Parts,
}
}
func (n Name) Attributes() map[string]interface{} {
return n.attributes
return nil
}
func (n Name) Position() *node.Position {

View File

@ -5,21 +5,21 @@ import (
)
type NamePart struct {
attributes map[string]interface{}
position *node.Position
position *node.Position
Value string
}
func NewNamePart(Value string) node.Node {
return &NamePart{
map[string]interface{}{
"Value": Value,
},
nil,
Value,
}
}
func (n NamePart) Attributes() map[string]interface{} {
return n.attributes
return map[string]interface{}{
"Value": n.Value,
}
}
func (n NamePart) Position() *node.Position {

View File

@ -11,13 +11,8 @@ type Relative struct {
func NewRelative(Parts []node.Node) node.Node {
return &Relative{
Name{
map[string]interface{}{},
nil,
Parts,
},
}
}
func (n Relative) Attributes() map[string]interface{} {
return n.attributes
}

View File

@ -1,30 +1,19 @@
package node
type Nullable struct {
attributes map[string]interface{}
position *Position
expr Node
position *Position
Expr Node
}
func NewNullable(Expression Node) Node {
return &Nullable{
map[string]interface{}{},
nil,
Expression,
}
}
func (n Nullable) Attributes() map[string]interface{} {
return n.attributes
}
func (n Nullable) Attribute(Key string) interface{} {
return n.attributes[Key]
}
func (n Nullable) SetAttribute(Key string, Value interface{}) Node {
n.attributes[Key] = Value
return n
return nil
}
func (n Nullable) Position() *Position {
@ -41,9 +30,9 @@ func (n Nullable) Walk(v Visitor) {
return
}
if n.expr != nil {
vv := v.GetChildrenVisitor("expr")
n.expr.Walk(vv)
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)

View File

@ -1,20 +1,19 @@
package node
type Parameter struct {
attributes map[string]interface{}
position *Position
ByRef bool
Variadic bool
VariableType Node
Variable Node
DefaultValue Node
}
func NewParameter(VariableType Node, Variable Node, DefaultValue Node, byRef bool, variadic bool) Node {
func NewParameter(VariableType Node, Variable Node, DefaultValue Node, ByRef bool, Variadic bool) Node {
return &Parameter{
map[string]interface{}{
"byRef": byRef,
"variadic": variadic,
},
nil,
ByRef,
Variadic,
VariableType,
Variable,
DefaultValue,
@ -22,16 +21,10 @@ func NewParameter(VariableType Node, Variable Node, DefaultValue Node, byRef boo
}
func (n Parameter) Attributes() map[string]interface{} {
return n.attributes
}
func (n Parameter) Attribute(Key string) interface{} {
return n.attributes[Key]
}
func (n Parameter) SetAttribute(Key string, Value interface{}) Node {
n.attributes[Key] = Value
return n
return map[string]interface{}{
"ByRef": n.ByRef,
"Variadic": n.Variadic,
}
}
func (n Parameter) Position() *Position {

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